Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixups #7813

Merged
merged 5 commits into from
Mar 21, 2020
Merged

Fixups #7813

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

@elad335 elad335 Mar 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if can simply be moved above m_state.wait(state).

return false;
}

return true;
return m_state.load() == thread_state::finished;
}

void thread_base::notify()
Expand Down