[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/38741 CVS commit: src/lib/libpthread
The following reply was made to PR lib/38741; it has been noted by GNATS.
From: Andrew Doran <ad%netbsd.org@localhost>
Subject: PR/38741 CVS commit: src/lib/libpthread
Date: Sun, 25 May 2008 17:05:29 +0000 (UTC)
Module Name: src
Committed By: ad
Date: Sun May 25 17:05:29 UTC 2008
src/lib/libpthread: pthread.c pthread_barrier.c pthread_cond.c
pthread_int.h pthread_mutex.c pthread_rwlock.c
PR lib/38741 priority inversion in libpthread breaks apps that use
- Change condvar sync so that we never take the condvar's spinlock without
first holding the caller-provided mutex. Previously, the spinlock was only
taken without the mutex in an error path, but it was enough to trigger the
problem described in the PR.
- Even with this change, applications calling pthread_cond_signal/broadcast
without holding the interlocking mutex are still subject to the problem
described in the PR. POSIX discourages this saying that it leads to
undefined scheduling behaviour, which seems good enough for the time being.
- Elsewhere, use a hash of mutexes instead of per-object spinlocks to
synchronize entry/exit from sleep queues.
- Simplify how sleep queues are maintained.
To generate a diff of this commit:
cvs rdiff -r1.100 -r1.101 src/lib/libpthread/pthread.c
cvs rdiff -r1.17 -r1.18 src/lib/libpthread/pthread_barrier.c
cvs rdiff -r1.42 -r1.43 src/lib/libpthread/pthread_cond.c
cvs rdiff -r1.68 -r1.69 src/lib/libpthread/pthread_int.h
cvs rdiff -r1.49 -r1.50 src/lib/libpthread/pthread_mutex.c
cvs rdiff -r1.29 -r1.30 src/lib/libpthread/pthread_rwlock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Main Index |
Thread Index |