X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fthread.h;h=e62cb2ba1dce34ae97eb175d11d9c31234a33572;hb=aecefb5d1dfdab6b004796c8b0b48fd2ab6643df;hp=249d2260923695548df42bb85043ff6db72ca75b;hpb=f5bb745fdcc44fb8781c188ee8a909efbca79f7b;p=sbcl.git diff --git a/src/runtime/thread.h b/src/runtime/thread.h index 249d226..e62cb2b 100644 --- a/src/runtime/thread.h +++ b/src/runtime/thread.h @@ -30,28 +30,37 @@ static inline lispobj thread_state(struct thread *thread) { lispobj state; + sigset_t old; + block_blockable_signals(0, &old); pthread_mutex_lock(thread->state_lock); state = thread->state; pthread_mutex_unlock(thread->state_lock); + thread_sigmask(SIG_SETMASK,&old,0); return state; } static inline void set_thread_state(struct thread *thread, lispobj state) { + sigset_t old; + block_blockable_signals(0, &old); pthread_mutex_lock(thread->state_lock); thread->state = state; pthread_cond_broadcast(thread->state_cond); pthread_mutex_unlock(thread->state_lock); + thread_sigmask(SIG_SETMASK,&old,0); } static inline void wait_for_thread_state_change(struct thread *thread, lispobj state) { + sigset_t old; + block_blockable_signals(0, &old); pthread_mutex_lock(thread->state_lock); while (thread->state == state) pthread_cond_wait(thread->state_cond, thread->state_lock); pthread_mutex_unlock(thread->state_lock); + thread_sigmask(SIG_SETMASK,&old,0); } extern pthread_key_t lisp_thread;