mirror of https://git.musl-libc.org/git/musl
Browse Source
this should generate faster and smaller code, especially with inline syscalls. the conditional with cnt is ugly, but thankfully cnt is always a constant anyway so it gets evaluated at compile time. it may be preferable to make separate __wake and __wakeall macros without a count argument. priv flag is not used yet; private futex support still needs to be done at some point in the future.rs-1.0
2 changed files with 2 additions and 10 deletions
@ -1,9 +0,0 @@ |
|||
#include "pthread_impl.h" |
|||
#include <limits.h> |
|||
|
|||
void __wake(volatile int *addr, int cnt, int priv) |
|||
{ |
|||
if (priv) priv = 128; priv=0; |
|||
if (cnt<0) cnt = INT_MAX; |
|||
__syscall(SYS_futex, (long)addr, FUTEX_WAKE | priv, cnt); |
|||
} |
|||
Loading…
Reference in new issue