about summary refs log tree commit diff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-26 12:54:28 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-26 12:54:28 -0400
commit1fa05210100caefc8546746e08358d81739f4b41 (patch)
treef54a70f0e4c82aa215307a3b2f4eb026115b6311 /src/internal
parentfd142e5ec44aaafffbb8bb4ea41c4288d3fa937a (diff)
downloadmusl-1fa05210100caefc8546746e08358d81739f4b41.tar.gz
musl-1fa05210100caefc8546746e08358d81739f4b41.tar.xz
musl-1fa05210100caefc8546746e08358d81739f4b41.zip
fix lost signals in cond vars
due to moving waiters from the cond var to the mutex in bcast, these
waiters upon wakeup would steal slots in the count from newer waiters
that had not yet been signaled, preventing the signal function from
taking any action.

to solve the problem, we simply use two separate waiter counts, and so
that the original "total" waiters count is undisturbed by broadcast
and still available for signal.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/pthread_impl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 63639ec2..bbb4502f 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -70,6 +70,7 @@ struct __timer {
 #define _c_clock __u.__i[4]
 #define _c_lock __u.__i[5]
 #define _c_lockwait __u.__i[6]
+#define _c_waiters2 __u.__i[7]
 #define _rw_lock __u.__i[0]
 #define _rw_waiters __u.__i[1]
 #define _b_inst __u.__p[0]