summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-13 15:40:55 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-07-13 15:40:55 -0400
commit6405a5a68c0ad618e8b8ab169a0ac85bf43c65c1 (patch)
tree3623578a17345272aea774ee831fd258f1f23717 /src/lib/ecore
parentdab2a9ca689c70d449cfadb6492518c468f1d68f (diff)
ecore: immediately block animator ticking upon receiving an exit signal
Summary: when an exit (SIGINT, SIGQUIT, SIGTERM) signal is received, the ui should immediately stop updating in order to present the user with an instant response this uses a simple volatile int to block any ticks which begin after the signal is received; if a signal is received during a tick then it will complete normally fix T7000 Depends on D6589 Reviewers: ManMower Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl_main_loop Maniphest Tasks: T7000 Differential Revision: https://phab.enlightenment.org/D6590
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_anim.c6
-rw-r--r--src/lib/ecore/ecore_signal.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index d15a2703ec..fb6501c308 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -110,6 +110,8 @@ static Eina_Spinlock tick_queue_lock;
110static int tick_queue_count = 0; 110static int tick_queue_count = 0;
111static Eina_Bool tick_skip = EINA_FALSE; 111static Eina_Bool tick_skip = EINA_FALSE;
112 112
113extern volatile int exit_signal_received;
114
113static void 115static void
114_tick_send(signed char val) 116_tick_send(signed char val)
115{ 117{
@@ -367,7 +369,7 @@ _timer_tick_notify(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, voi
367 if ((!tick_skip) || (tick_queued == 1)) 369 if ((!tick_skip) || (tick_queued == 1))
368 { 370 {
369 ecore_loop_time_set(*t); 371 ecore_loop_time_set(*t);
370 _do_tick(); 372 if (!exit_signal_received) _do_tick();
371 _ecore_animator_flush(); 373 _ecore_animator_flush();
372 } 374 }
373 pt = *t; 375 pt = *t;
@@ -935,7 +937,7 @@ ecore_animator_custom_tick(void)
935{ 937{
936 EINA_MAIN_LOOP_CHECK_RETURN; 938 EINA_MAIN_LOOP_CHECK_RETURN;
937 if (src != ECORE_ANIMATOR_SOURCE_CUSTOM) return; 939 if (src != ECORE_ANIMATOR_SOURCE_CUSTOM) return;
938 _do_tick(); 940 if (!exit_signal_received) _do_tick();
939 _ecore_animator_flush(); 941 _ecore_animator_flush();
940} 942}
941 943
diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c
index 9fd9a7d8b9..65b9179393 100644
--- a/src/lib/ecore/ecore_signal.c
+++ b/src/lib/ecore/ecore_signal.c
@@ -39,6 +39,8 @@ static Eo *sig_pipe_handler = NULL;
39static Eina_Spinlock sig_pid_lock; 39static Eina_Spinlock sig_pid_lock;
40static Eina_List *sig_pid_info_list = NULL; 40static Eina_List *sig_pid_info_list = NULL;
41 41
42volatile int exit_signal_received = 0;
43
42typedef struct _Signal_Data 44typedef struct _Signal_Data
43{ 45{
44 int sig; 46 int sig;
@@ -171,6 +173,15 @@ _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED)
171 } 173 }
172 errno = err; 174 errno = err;
173 } 175 }
176 switch (sig)
177 {
178 case SIGQUIT:
179 case SIGINT:
180 case SIGTERM:
181 exit_signal_received = 1;
182 break;
183 default: break;
184 }
174} 185}
175 186
176static void 187static void
@@ -302,6 +313,7 @@ _ecore_signal_shutdown(void)
302# endif 313# endif
303 pthread_sigmask(SIG_BLOCK, &newset, NULL); 314 pthread_sigmask(SIG_BLOCK, &newset, NULL);
304#endif 315#endif
316 exit_signal_received = 0;
305} 317}
306 318
307void 319void