Project

General

Profile

« Previous | Next » 

Revision 2d4f29e7

Added by Samuel Williams over 4 years ago

Fix potential hang when joining threads.

If the thread termination invokes user code after th->status becomes
THREAD_KILLED, and the user unblock function causes that th->status to
become something else (e.g. THREAD_RUNNING), threads waiting in
thread_join_sleep will hang forever. We move the unblock function call
to before the thread status is updated, and allow threads to join as soon
as th->value becomes defined.

This reverts commit 6505c77501f1924571b2fe620c5c7b31ede0cd22.