cvs commit: src/sys/sys proc.h sleepqueue.h src/sys/kern kern_condvar.c kern_kse.c kern_sig.c kern_synch.c kern_thread.c subr_sleepqueue.c

David Xu davidxu at freebsd.org
Wed Feb 15 16:02:11 PST 2006


David Xu wrote:

>davidxu     2006-02-15 23:52:01 UTC
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/sys              proc.h sleepqueue.h 
>    sys/kern             kern_condvar.c kern_kse.c kern_sig.c 
>                         kern_synch.c kern_thread.c 
>                         subr_sleepqueue.c 
>  Log:
>  Fix a long standing race between sleep queue and thread
>  suspension code. When a thread A is going to sleep, it calls
>  sleepq_catch_signals() to detect any pending signals or thread
>  suspension request, if nothing happens, it returns without
>  holding process lock or scheduler lock, this opens a race
>  window which allows thread B to come in and do process
>  suspension work, however since A is still at running state,
>  thread B can do nothing to A, thread A continues, and puts
>  itself into actually sleeping state, but B has never seen it,
>  and it sits there forever until B is woken up by other threads
>  
>
Should be "until thread A is woken up ... ", sigh!


More information about the cvs-all mailing list