summaryrefslogtreecommitdiff
path: root/tdb/spinlock.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-10-22 22:39:59 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:05:23 -0700
commit1c386a909af69bc5b53eb03fedead725f5fc8331 (patch)
tree7e5cba2df52c1d422f8a32fa339172458089cd2d /tdb/spinlock.c
parent32ff5bca1517932b1e14caddd8d19fb29ef693ba (diff)
[PATCH] udev build tweaks to tdb's spinlock code
Diffstat (limited to 'tdb/spinlock.c')
-rw-r--r--tdb/spinlock.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/tdb/spinlock.c b/tdb/spinlock.c
index 4b17b1d943..9bf42adfcf 100644
--- a/tdb/spinlock.c
+++ b/tdb/spinlock.c
@@ -21,7 +21,7 @@
#define STANDALONE
#define TDB_DEBUG
#define HAVE_MMAP 1
-
+#include "../udev.h"
#if HAVE_CONFIG_H
#include <config.h>
@@ -40,7 +40,6 @@
#include "tdb.h"
#include "spinlock.h"
-#define DEBUG
#else
#include "includes.h"
#endif
@@ -299,10 +298,8 @@ static void __write_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!(rwlock->count & RWLOCK_BIAS))
- fprintf(stderr, "bug: write_unlock\n");
-#endif
+ dbg("bug: write_unlock");
rwlock->count &= ~RWLOCK_BIAS;
__spin_unlock(&rwlock->lock);
@@ -312,13 +309,11 @@ static void __read_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!rwlock->count)
- fprintf(stderr, "bug: read_unlock\n");
+ dbg("bug: read_unlock");
if (rwlock->count & RWLOCK_BIAS)
- fprintf(stderr, "bug: read_unlock\n");
-#endif
+ dbg("bug: read_unlock");
rwlock->count--;
__spin_unlock(&rwlock->lock);