diff options
Diffstat (limited to 'lib/libpthread/thread/thr_sigsuspend.c')
-rw-r--r-- | lib/libpthread/thread/thr_sigsuspend.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_sigsuspend.c b/lib/libpthread/thread/thr_sigsuspend.c index 7ce027a..9ada1b2 100644 --- a/lib/libpthread/thread/thr_sigsuspend.c +++ b/lib/libpthread/thread/thr_sigsuspend.c @@ -53,13 +53,14 @@ _sigsuspend(const sigset_t *set) memcpy(&curthread->tmbx.tm_context.uc_sigmask, set, sizeof(sigset_t)); + THR_LOCK_SWITCH(curthread); THR_SET_STATE(curthread, PS_SIGSUSPEND); - THR_SCHED_UNLOCK(curthread, curthread); - /* Wait for a signal: */ _thr_sched_switch(curthread); + THR_UNLOCK_SWITCH(curthread); + /* Always return an interrupted error: */ errno = EINTR; |