Try to purge thread_state::detached

It's rarely necessary, but can cause unexpected problems.
This commit is contained in:
Nekotekina committed 2020-02-28 21:11:13 +03:00
1 parent cb047fcc75
commit 490f58ff3c
5 files changed
+31 -31

No files matched your search

+4 -2
View File
@@ -1858,11 +1858,13 @@ bool thread_base::finalize(int) noexcept
fsoft, fhard, ctxvol, ctxinv);
// Return true if need to delete thread object
const bool result = m_state.exchange(thread_state::finished) == thread_state::detached;
const bool ok = m_state.exchange(thread_state::finished) <= thread_state::aborting;
// Signal waiting threads
m_state.notify_all();
return result;
// No detached thread supported atm
return !ok;
}
void thread_base::finalize() noexcept