diff --git a/lib/libc_r/uthread/uthread_sig.c b/lib/libc_r/uthread/uthread_sig.c index fd5180c9068..9ca197efdbe 100644 --- a/lib/libc_r/uthread/uthread_sig.c +++ b/lib/libc_r/uthread/uthread_sig.c @@ -932,6 +932,12 @@ _thread_sig_wrapper(void) thread->curframe = NULL; PTHREAD_ASSERT(psf != NULL, "Invalid signal frame in signal handler"); + /* + * We're coming from the kernel scheduler; clear the in + * scheduler flag: + */ + _thread_kern_in_sched = 0; + /* Check the threads previous state: */ if (psf->saved_state.psd_state != PS_RUNNING) { /* diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index fd5180c9068..9ca197efdbe 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/thread/thr_sig.c @@ -932,6 +932,12 @@ _thread_sig_wrapper(void) thread->curframe = NULL; PTHREAD_ASSERT(psf != NULL, "Invalid signal frame in signal handler"); + /* + * We're coming from the kernel scheduler; clear the in + * scheduler flag: + */ + _thread_kern_in_sched = 0; + /* Check the threads previous state: */ if (psf->saved_state.psd_state != PS_RUNNING) { /* diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c index fd5180c9068..9ca197efdbe 100644 --- a/lib/libpthread/thread/thr_sig.c +++ b/lib/libpthread/thread/thr_sig.c @@ -932,6 +932,12 @@ _thread_sig_wrapper(void) thread->curframe = NULL; PTHREAD_ASSERT(psf != NULL, "Invalid signal frame in signal handler"); + /* + * We're coming from the kernel scheduler; clear the in + * scheduler flag: + */ + _thread_kern_in_sched = 0; + /* Check the threads previous state: */ if (psf->saved_state.psd_state != PS_RUNNING) { /*