mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibC+LibPthread: Use FUTEX_PRIVATE_FLAG in more places
Performance go brrrrr
This commit is contained in:
parent
39a3f42534
commit
65b0642dd0
3 changed files with 5 additions and 5 deletions
|
@ -45,7 +45,7 @@ int pthread_once(pthread_once_t* self, void (*callback)(void))
|
|||
// anyone.
|
||||
break;
|
||||
case State::PERFORMING_WITH_WAITERS:
|
||||
futex(self, FUTEX_WAKE, INT_MAX, nullptr, nullptr, 0);
|
||||
futex_wake(self, INT_MAX);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ int pthread_once(pthread_once_t* self, void (*callback)(void))
|
|||
[[fallthrough]];
|
||||
case State::PERFORMING_WITH_WAITERS:
|
||||
// Let's wait for it.
|
||||
futex(self, FUTEX_WAIT, state2, nullptr, nullptr, 0);
|
||||
futex_wait(self, state2, nullptr, 0);
|
||||
// We have been woken up, but that might have been due to a signal
|
||||
// or something, so we have to reevaluate. We need acquire ordering
|
||||
// here for the same reason as above. Hopefully we'll just see
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue