mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12:00
Improve raw_notify a bit
This commit is contained in:
parent
49610f52f5
commit
10caa2981f
3 changed files with 13 additions and 2 deletions
|
@ -1899,7 +1899,17 @@ void thread_base::initialize(void (*error_cb)(), bool(*wait_cb)(const void*))
|
||||||
void thread_base::notify_abort() noexcept
|
void thread_base::notify_abort() noexcept
|
||||||
{
|
{
|
||||||
m_signal.try_inc();
|
m_signal.try_inc();
|
||||||
atomic_storage_futex::raw_notify(+m_state_notifier);
|
|
||||||
|
while (auto ptr = m_state_notifier.load())
|
||||||
|
{
|
||||||
|
// Since this function is not perfectly implemented, run it in a loop
|
||||||
|
atomic_storage_futex::raw_notify(ptr);
|
||||||
|
|
||||||
|
if (m_state_notifier.load() == ptr)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool thread_base::finalize(thread_state result_state) noexcept
|
bool thread_base::finalize(thread_state result_state) noexcept
|
||||||
|
|
|
@ -311,6 +311,7 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
|
||||||
|
|
||||||
if (_this->m_state >= thread_state::aborting)
|
if (_this->m_state >= thread_state::aborting)
|
||||||
{
|
{
|
||||||
|
_this->m_state_notifier.store(data);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1915,7 +1915,7 @@ error_code sys_isolated_spu_create(ppu_thread& ppu, vm::ptr<u32> id, vm::ptr<voi
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool isolated = false>
|
template <bool isolated = false>
|
||||||
error_code raw_spu_destroy(ppu_thread& ppu, u32 id)
|
error_code raw_spu_destroy(ppu_thread& ppu, u32 id)
|
||||||
{
|
{
|
||||||
const u32 idm_id = spu_thread::find_raw_spu(id);
|
const u32 idm_id = spu_thread::find_raw_spu(id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue