summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/evmgr.c8
-rw-r--r--src/evmgr.h1
-rw-r--r--src/jobs.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/evmgr.c b/src/evmgr.c
index 557a9f3a..744d08ba 100644
--- a/src/evmgr.c
+++ b/src/evmgr.c
@@ -48,6 +48,14 @@ struct evmgr
#define EVLOOP_STATE_RUN 2U
/**
+ * prepare the evmgr to run
+ */
+void evmgr_prepare_run(struct evmgr *evmgr)
+{
+ evmgr->state = EVLOOP_STATE_WAIT|EVLOOP_STATE_RUN;
+}
+
+/**
* Run the event loop is set.
*/
void evmgr_run(struct evmgr *evmgr)
diff --git a/src/evmgr.h b/src/evmgr.h
index c78ea33f..2dde16b3 100644
--- a/src/evmgr.h
+++ b/src/evmgr.h
@@ -20,6 +20,7 @@
struct evmgr;
+extern void evmgr_prepare_run(struct evmgr *evmgr);
extern void evmgr_run(struct evmgr *evmgr);
extern void evmgr_job_run(int signum, struct evmgr *evmgr);
extern int evmgr_can_run(struct evmgr *evmgr);
diff --git a/src/jobs.c b/src/jobs.c
index 936c6f1d..a518766b 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -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);