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

Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions Utilities/Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,10 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
{
auto tls_error_cb = []()
{
const auto _this = thread_ctrl::get_current();

if constexpr (!result::empty)
{
// Construct using default constructor in the case of failure
new (static_cast<result*>(static_cast<named_thread*>(_this))->get()) typename result::type();
new (static_cast<result*>(static_cast<named_thread*>(thread_ctrl::get_current()))->get()) typename result::type();
}
};

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

version: '{build}'

image: Visual Studio 2019
image: Previous Visual Studio 2019

environment:
QTDIR: C:\Qt\5.14\msvc2017_64
Expand Down
2 changes: 1 addition & 1 deletion llvm
Submodule llvm updated 1 files
+8 −8 azure-pipelines.yml
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace rsx
}
else
{
while (!exit && thread_ctrl::state() <= thread_state::aborting)
while (!exit && thread_ctrl::state() != thread_state::aborting)
{
refresh();

Expand Down