Skip to content

Commit 91ff73d

Browse files
authored
Merge pull request #2392 from c1728p9/fix_terminate_join
Fix joining a terminated thread
2 parents 2f127cb + e44ab35 commit 91ff73d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rtos/rtos/Thread.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ osStatus Thread::terminate() {
104104
ret = osThreadTerminate(_tid);
105105
_tid = (osThreadId)NULL;
106106

107+
// Wake threads joining the terminated thread
108+
_join_sem.release();
109+
107110
_mutex.unlock();
108111
return ret;
109112
}

0 commit comments

Comments
 (0)