aboutsummaryrefslogtreecommitdiff
path: root/libthreads/rwlock.h
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-06-19 21:20:57 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 18:42:22 +0200
commit835b293d35a209d38047126443d41fa7090daa4c (patch)
tree5bf956895e6030f91cd618fb191b2151f6d25423 /libthreads/rwlock.h
parentdc0b5a43224999223a246870912b0f292b1980e9 (diff)
downloadhurd-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/rwlock.h')
-rw-r--r--libthreads/rwlock.h6
1 files changed, 3 insertions, 3 deletions
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);