From 8562a401363d244cdfccacd40b0c76026623d182 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 7 Jun 2006 21:39:01 +0000 Subject: [PATCH] Fix the previous revision. --- src/lib/empthread/pthread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/empthread/pthread.c b/src/lib/empthread/pthread.c index f3503cf8..6cf2ffa3 100644 --- a/src/lib/empthread/pthread.c +++ b/src/lib/empthread/pthread.c @@ -342,7 +342,6 @@ empth_select(int fd, int flags) done: pthread_mutex_lock(&mtx_ctxsw); empth_restorectx(); - } static void @@ -388,6 +387,7 @@ empth_wait_for_shutdown(void) sigemptyset(&set); sigaddset(&set, SIGINT); sigaddset(&set, SIGTERM); + pthread_mutex_unlock(&mtx_ctxsw); for (;;) { empth_status("waiting for signals"); err = sigwait(&set, &sig); @@ -396,6 +396,8 @@ empth_wait_for_shutdown(void) continue; } empth_status("got awaited signal %d", sig); + pthread_mutex_lock(&mtx_ctxsw); + empth_restorectx(); return sig; } }