1
0
Fork 0

Set thread's state to `STOPPED` when the thread function finishes. (#8283)

This commit is contained in:
Manuel Pöter 2019-02-28 11:54:49 +01:00 committed by Jan
parent 8e814744a5
commit bed5a5f9a2
1 changed files with 1 additions and 0 deletions

View File

@ -72,6 +72,7 @@ void Thread::startThread(void* arg) {
// make sure we drop our reference when we are finished!
auto guard = scopeGuard([ptr]() {
LOCAL_THREAD_NAME = nullptr;
ptr->_state.store(ThreadState::STOPPED);
ptr->releaseRef();
});