summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-02-01 16:41:53 -0500
committerRich Felker <dalias@aerifal.cx>2013-02-01 16:41:53 -0500
commitfacc6acbfd20accea435d10fdd070b23877e40db (patch)
treed6d52d22c5463a9e46e2d48efa9997407111d5bf /src/internal
parent96fbcf7d80f469e39d1dd12533f8bb8d13b64fe5 (diff)
downloadmusl-facc6acbfd20accea435d10fdd070b23877e40db.tar.gz
replace __wake function with macro that performs direct syscall
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.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/pthread_impl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 4215e67a..544da9ce 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -106,7 +106,8 @@ void __unmapself(void *, size_t);
int __timedwait(volatile int *, int, clockid_t, const struct timespec *, void (*)(void *), void *, int);
void __wait(volatile int *, volatile int *, int, int);
-void __wake(volatile int *, int, int);
+#define __wake(addr, cnt, priv) \
+ __syscall(SYS_futex, addr, FUTEX_WAKE, (cnt)<0?INT_MAX:(cnt))
void __acquire_ptc();
void __release_ptc();