summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-07-30 17:13:00 +0000
committermtm <mtm@FreeBSD.org>2004-07-30 17:13:00 +0000
commit24912a0c07678c94fd76f096fc5ff24a19323273 (patch)
treeae9aa8598ff36d55936248773fb2d2749d836066 /lib/libthr/thread/thr_mutex.c
parent9fb1cda8d0409e8a7c170f65b4fca63479fd7e86 (diff)
downloadFreeBSD-src-24912a0c07678c94fd76f096fc5ff24a19323273.zip
FreeBSD-src-24912a0c07678c94fd76f096fc5ff24a19323273.tar.gz
o Assertions to catch that stuff that shouldn't happen is not happening.
o In the rwlock code: move a duplicated check inside an if..else to after the if...else clause. o When initializing a static rwlock move the initialization check inside the lock. o In thr_setschedparam.c: When breaking out of the trylock...retry if busy loop make sure to reset the mtx pointer to null if the mutex is nolonger in a queue.
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index ca16cb6..2771a65 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -840,6 +840,8 @@ void
readjust_priorities(struct pthread *pthread, struct pthread_mutex *mtx)
{
if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0) {
+ PTHREAD_ASSERT(mtx != NULL,
+ "mutex is NULL when it should not be");
mutex_queue_remove(mtx, pthread);
mutex_queue_enq(mtx, pthread);
PTHREAD_LOCK(mtx->m_owner);
OpenPOWER on IntegriCloud