summaryrefslogtreecommitdiffstats
path: root/src/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jobs.c')
-rw-r--r--src/jobs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 4a88c303..d06d24cf 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -337,7 +337,7 @@ static void evloop_release()
{
struct thread *nh, *ct = current_thread;
- if (evloop.holder == ct) {
+ if (ct && evloop.holder == ct) {
nh = ct->nholder;
evloop.holder = nh;
if (nh)
@@ -397,6 +397,7 @@ static void evloop_acquire()
*/
static void thread_enter(volatile struct thread *me)
{
+ evloop_release();
/* initialize description of itself and link it in the list */
me->tid = pthread_self();
me->stop = 0;