sig-monitor: Fix exit in signal handler
[src/app-framework-binder.git] / src / jobs.c
index 936c6f1..94bdce8 100644 (file)
@@ -389,6 +389,7 @@ static void thread_run_internal(volatile struct thread *me)
                                abort();
                        }
                        /* run the events */
+                       evmgr_prepare_run(evmgr);
                        pthread_mutex_unlock(&mutex);
                        sig_monitor(0, (void(*)(int,void*))evmgr_job_run, evmgr);
                        pthread_mutex_lock(&mutex);
@@ -837,7 +838,8 @@ void jobs_exit(void (*handler)())
                t = t->next;
        }
 
-       /* wait the threads */
+       /* wake up the threads */
+       evloop_wakeup();
        pthread_cond_broadcast(&cond);
 
        /* leave */