mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 14:37:08 +00:00
Fix shared_cv deadlock
Was incorrect order of args for futex
This commit is contained in:
parent
123321e2bc
commit
de973e369f
5 changed files with 22 additions and 18 deletions
|
|
@ -34,7 +34,7 @@ protected:
|
|||
}
|
||||
|
||||
// Internal waiting function
|
||||
void impl_wait(shared_mutex &mutex, unsigned _old,
|
||||
void impl_wait(shared_mutex &mutex, unsigned _val,
|
||||
std::uint64_t usec_timeout) noexcept;
|
||||
|
||||
// Try to notify up to _count threads
|
||||
|
|
@ -44,13 +44,13 @@ public:
|
|||
constexpr shared_cv() = default;
|
||||
|
||||
void wait(shared_mutex &mutex, std::uint64_t usec_timeout = -1) noexcept {
|
||||
const unsigned _old = add_waiter();
|
||||
if (!_old) {
|
||||
const unsigned _val = add_waiter();
|
||||
if (!_val) {
|
||||
return;
|
||||
}
|
||||
|
||||
mutex.unlock();
|
||||
impl_wait(mutex, _old, usec_timeout);
|
||||
impl_wait(mutex, _val, usec_timeout);
|
||||
}
|
||||
|
||||
// Wake one thread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue