1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

init_mutex.hpp: More fixes

This commit is contained in:
Eladash 2024-03-06 19:27:58 +02:00 committed by Elad.Ash
parent 5e24167d6c
commit 4512c10ce5

View File

@ -63,9 +63,6 @@ namespace stx
if (val & c_init_bit)
{
// Failure
_this = nullptr;
if constexpr (Forced()())
{
// Forced reset
@ -73,12 +70,23 @@ namespace stx
while (val != 1)
{
if constexpr (sizeof...(FAndArgs))
{
if (!invoked_func)
{
invoke_callback(0, std::forward<FAndArgs>(args)...);
invoked_func = true;
}
}
// Wait for other users to finish their work
_this->m_state.wait(val);
val = _this->m_state;
}
}
// Failure
_this = nullptr;
break;
}