mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:24:58 +00:00
LibC: Fix passing futex value for FUTEX_WAKE_BITSET
FUTEX_WAKE_BITSET, like FUTEX_WAKE, accepts the number of waiting threads to wake, not the current value of the futex. Pass UINT32_MAX instead.
This commit is contained in:
parent
f660fc97a9
commit
0a6690b745
1 changed files with 1 additions and 1 deletions
|
@ -852,7 +852,7 @@ int pthread_rwlock_unlock(pthread_rwlock_t* lockval_p)
|
|||
auto desired = current & ~(writer_locked_mask | writer_intent_mask);
|
||||
AK::atomic_store(lockp, desired, AK::MemoryOrder::memory_order_release);
|
||||
// Then wake both readers and writers, if any.
|
||||
auto rc = futex(lockp, FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG, current, nullptr, nullptr, (current & writer_wake_mask) | reader_wake_mask);
|
||||
auto rc = futex(lockp, FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG, UINT32_MAX, nullptr, nullptr, (current & writer_wake_mask) | reader_wake_mask);
|
||||
if (rc < 0)
|
||||
return errno;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue