From 24912a0c07678c94fd76f096fc5ff24a19323273 Mon Sep 17 00:00:00 2001 From: mtm Date: Fri, 30 Jul 2004 17:13:00 +0000 Subject: 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. --- lib/libthr/thread/thr_mutex.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libthr/thread/thr_mutex.c') 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); -- cgit v1.1