Now that the kernel distinguishes between process-shared and
process-private futexes make libc/libpthread use process-private ones.
ok?
Index: lib/libc/thread/synch.h
===================================================================
RCS file: /cvs/src/lib/libc/thread/synch.h,v
retrieving revision 1.2
diff -u -p -r1.2 synch.h
--- lib/libc/thread/synch.h 5 Sep 2017 02:40:54 -0000 1.2
+++ lib/libc/thread/synch.h 3 Jun 2018 21:58:58 -0000
@@ -22,14 +22,14 @@
static inline int
_wake(volatile uint32_t *p, int n)
{
- return futex(p, FUTEX_WAKE, n, NULL, NULL);
+ return futex(p, FUTEX_WAKE_PRIVATE, n, NULL, NULL);
}
static inline void
_wait(volatile uint32_t *p, int val)
{
while (*p != (uint32_t)val)
- futex(p, FUTEX_WAIT, val, NULL, NULL);
+ futex(p, FUTEX_WAIT_PRIVATE, val, NULL, NULL);
}
static inline int
@@ -38,7 +38,7 @@ _twait(volatile uint32_t *p, int val, cl
struct timespec rel;
if (abs == NULL)
- return futex(p, FUTEX_WAIT, val, NULL, NULL);
+ return futex(p, FUTEX_WAIT_PRIVATE, val, NULL, NULL);
if (abs->tv_nsec >= 1000000000 || clock_gettime(clockid, &rel))
return (EINVAL);
@@ -51,11 +51,11 @@ _twait(volatile uint32_t *p, int val, cl
if (rel.tv_sec < 0)
return (ETIMEDOUT);
- return futex(p, FUTEX_WAIT, val, &rel, NULL);
+ return futex(p, FUTEX_WAIT_PRIVATE, val, &rel, NULL);
}
static inline int
_requeue(volatile uint32_t *p, int n, int m, volatile uint32_t *q)
{
- return futex(p, FUTEX_REQUEUE, n, (void *)(long)m, q);
+ return futex(p, FUTEX_REQUEUE_PRIVATE, n, (void *)(long)m, q);
}