From 835b293d35a209d38047126443d41fa7090daa4c Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Jun 2017 21:20:57 +0200 Subject: Use our own variant of 'assert' and 'assert_perror'. Our variants print stack traces on failures. This will make locating errors much easier. --- libthreads/cancel-cond.c | 4 ++-- libthreads/cprocs.c | 4 ++-- libthreads/rwlock.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libthreads') diff --git a/libthreads/cancel-cond.c b/libthreads/cancel-cond.c index 0cd5f0f1..3aa33f6a 100644 --- a/libthreads/cancel-cond.c +++ b/libthreads/cancel-cond.c @@ -20,7 +20,7 @@ #include #include #include "cthread_internals.h" -#include +#include /* Just like condition_wait, but cancellable. Returns true if cancelled. */ int @@ -37,7 +37,7 @@ hurd_condition_wait (condition_t c, mutex_t m) cproc_t p = cproc_self (); int cancel; - assert (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */ + assert_backtrace (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */ p->state = CPROC_CONDWAIT | CPROC_SWITCHING; diff --git a/libthreads/cprocs.c b/libthreads/cprocs.c index 5459d7de..5fb138d2 100644 --- a/libthreads/cprocs.c +++ b/libthreads/cprocs.c @@ -233,7 +233,7 @@ #include "cthread_internals.h" #include #include /* GNU */ -#include +#include /* * Port_entry's are used by cthread_mach_msg to store information @@ -343,7 +343,7 @@ cthread_wire(void) register cproc_t p = cproc_self(); /* In GNU, we wire all threads on creation (in cproc_alloc). */ - assert (p->wired != MACH_PORT_NULL); + assert_backtrace (p->wired != MACH_PORT_NULL); } /* diff --git a/libthreads/rwlock.h b/libthreads/rwlock.h index 44d9a35d..cbe56d7c 100644 --- a/libthreads/rwlock.h +++ b/libthreads/rwlock.h @@ -20,7 +20,7 @@ #define _RWLOCK_H 1 #include -#include +#include #include #ifdef RWLOCK_DEFINE_EI @@ -89,7 +89,7 @@ RWLOCK_EI void rwlock_reader_unlock (struct rwlock *lock) { mutex_lock (&lock->master); - assert (lock->readers); + assert_backtrace (lock->readers); lock->readers--; if (lock->readers_waiting || lock->writers_waiting) condition_broadcast (&lock->wakeup); @@ -101,7 +101,7 @@ RWLOCK_EI void rwlock_writer_unlock (struct rwlock *lock) { mutex_lock (&lock->master); - assert (lock->readers == -1); + assert_backtrace (lock->readers == -1); lock->readers = 0; if (lock->readers_waiting || lock->writers_waiting) condition_broadcast (&lock->wakeup); -- cgit v1.2.3