mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Threads: minor simplification
This commit is contained in:
parent
f1c65dcefc
commit
b954a41f2a
1 changed files with 4 additions and 8 deletions
|
@ -1872,7 +1872,7 @@ void thread_base::start()
|
||||||
m_thread.release(_self);
|
m_thread.release(_self);
|
||||||
verify(HERE), _self != reinterpret_cast<u64>(this);
|
verify(HERE), _self != reinterpret_cast<u64>(this);
|
||||||
atomic_storage<thread_base*>::store(*tls, this);
|
atomic_storage<thread_base*>::store(*tls, this);
|
||||||
s_thread_pool[pos].notify_all();
|
s_thread_pool[pos].notify_one();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2035,7 +2035,6 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept
|
||||||
|
|
||||||
const auto fake_self = reinterpret_cast<thread_base*>(_self);
|
const auto fake_self = reinterpret_cast<thread_base*>(_self);
|
||||||
|
|
||||||
atomic_wait_engine::set_wait_callback(nullptr);
|
|
||||||
g_tls_log_prefix = []() -> std::string { return {}; };
|
g_tls_log_prefix = []() -> std::string { return {}; };
|
||||||
thread_ctrl::g_tls_this_thread = fake_self;
|
thread_ctrl::g_tls_this_thread = fake_self;
|
||||||
|
|
||||||
|
@ -2065,7 +2064,7 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept
|
||||||
const u64 _self = reinterpret_cast<u64>(*ptls);
|
const u64 _self = reinterpret_cast<u64>(*ptls);
|
||||||
|
|
||||||
// Wake up a thread and make sure it's joined
|
// Wake up a thread and make sure it's joined
|
||||||
s_thread_pool[i].notify_all();
|
s_thread_pool[i].notify_one();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const HANDLE handle = reinterpret_cast<HANDLE>(_self);
|
const HANDLE handle = reinterpret_cast<HANDLE>(_self);
|
||||||
|
@ -2139,11 +2138,8 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore thread base
|
// Return new entry point
|
||||||
const auto _this = atomic_storage<thread_base*>::load(*tls);
|
return (*tls)->entry_point;
|
||||||
|
|
||||||
// Return new entry
|
|
||||||
return _this->entry_point;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
thread_base::native_entry thread_base::make_trampoline(u64(*entry)(thread_base* _base))
|
thread_base::native_entry thread_base::make_trampoline(u64(*entry)(thread_base* _base))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue