Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rtos/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ osStatus Thread::terminate() {
_tid = (osThreadId_t)NULL;
if (!_finished) {
_finished = true;
ret = osThreadTerminate(local_id);
// if local_id == 0 Thread was not started in first place
// and does not have to be terminated
if (local_id != 0) {
ret = osThreadTerminate(local_id);
}
}
_mutex.unlock();
return ret;
Expand Down