Fix joining a terminated thread

When a thread is terminated signal the join semaphore so any threads
joining the terminated thread wake up as expected.
pull/2392/head
Russ Butler 2016-08-08 16:42:20 -05:00
parent 0712b8adf6
commit e44ab35c42
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ osStatus Thread::terminate() {
ret = osThreadTerminate(_tid);
_tid = (osThreadId)NULL;
// Wake threads joining the terminated thread
_join_sem.release();
_mutex.unlock();
return ret;
}