diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /libthreads | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2 hurd-835b293d35a209d38047126443d41fa7090daa4c.zip |
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating
errors much easier.
Diffstat (limited to 'libthreads')
-rw-r--r-- | libthreads/cancel-cond.c | 4 | ||||
-rw-r--r-- | libthreads/cprocs.c | 4 | ||||
-rw-r--r-- | libthreads/rwlock.h | 6 |
3 files changed, 7 insertions, 7 deletions
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 <hurd/signal.h> #include <cthreads.h> #include "cthread_internals.h" -#include <assert.h> +#include <assert-backtrace.h> /* 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 <mach/message.h> #include <hurd/threadvar.h> /* GNU */ -#include <assert.h> +#include <assert-backtrace.h> /* * 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 <cthreads.h> -#include <assert.h> +#include <assert-backtrace.h> #include <features.h> #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); |