From 7f5dd1dd621c164fd0dedc737782509f6d9cc778 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 21 Mar 2020 10:36:04 +0300 Subject: [PATCH] Fix thread_base::join --- Utilities/Thread.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 1414bd540b..121c0bdc4e 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1990,16 +1990,13 @@ thread_base::~thread_base() bool thread_base::join() const { - for (auto state = m_state.load(); state != thread_state::finished;) + for (auto state = m_state.load(); state != thread_state::finished && state != thread_state::errored;) { m_state.wait(state); state = m_state; - - if (state == thread_state::errored) - return false; } - return true; + return m_state.load() == thread_state::finished; } void thread_base::notify()