Module Name: src Committed By: ad Date: Wed Jun 3 22:10:24 UTC 2020
Modified Files: src/lib/libpthread: pthread.c pthread_cond.c pthread_mutex.c Log Message: Deal with a couple of problems with threads being awoken early due to timeouts or cancellation where: - The restarting thread calls _lwp_exit() before another thread gets around to waking it with _lwp_unpark(), leading to ESRCH (observed by joerg@). (I may have removed a similar check mistakenly over the weekend.) - The restarting thread considers itself gone off the sleep queue but at the same time another thread is part way through waking it, and hasn't fully completed that operation yet by setting thread->pt_mutexwait = 0. I think that could have potentially lead to the list of waiters getting messed up given the right circumstances. To generate a diff of this commit: cvs rdiff -u -r1.172 -r1.173 src/lib/libpthread/pthread.c cvs rdiff -u -r1.70 -r1.71 src/lib/libpthread/pthread_cond.c cvs rdiff -u -r1.78 -r1.79 src/lib/libpthread/pthread_mutex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.