diff --git a/rtos/rtos/Thread.cpp b/rtos/rtos/Thread.cpp index bd254a56ec9..cb62d77165c 100644 --- a/rtos/rtos/Thread.cpp +++ b/rtos/rtos/Thread.cpp @@ -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; }