chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Revert previous dev_d.c change, it's not what is causing HAL problems.
[elogind.git]
/
tdb
/
spinlock.c
diff --git
a/tdb/spinlock.c
b/tdb/spinlock.c
index 4b17b1d9431e6e5022fe1d59e096c07e34945f46..451617fadeb4f57d01265a75527ffbae8eb3cb29 100644
(file)
--- a/
tdb/spinlock.c
+++ b/
tdb/spinlock.c
@@
-22,12
+22,12
@@
#define TDB_DEBUG
#define HAVE_MMAP 1
#define TDB_DEBUG
#define HAVE_MMAP 1
-
#if HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef STANDALONE
#if HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef STANDALONE
+#define _KLIBC_HAS_ARCH_SIG_ATOMIC_T
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@
-39,8
+39,9
@@
#include <signal.h>
#include "tdb.h"
#include "spinlock.h"
#include <signal.h>
#include "tdb.h"
#include "spinlock.h"
+#include "../udev.h"
+#include "../logging.h"
-#define DEBUG
#else
#include "includes.h"
#endif
#else
#include "includes.h"
#endif
@@
-299,10
+300,8
@@
static void __write_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!(rwlock->count & RWLOCK_BIAS))
if (!(rwlock->count & RWLOCK_BIAS))
- fprintf(stderr, "bug: write_unlock\n");
-#endif
+ dbg("bug: write_unlock");
rwlock->count &= ~RWLOCK_BIAS;
__spin_unlock(&rwlock->lock);
rwlock->count &= ~RWLOCK_BIAS;
__spin_unlock(&rwlock->lock);
@@
-312,13
+311,11
@@
static void __read_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!rwlock->count)
if (!rwlock->count)
-
fprintf(stderr, "bug: read_unlock\n
");
+
dbg("bug: read_unlock
");
if (rwlock->count & RWLOCK_BIAS)
if (rwlock->count & RWLOCK_BIAS)
- fprintf(stderr, "bug: read_unlock\n");
-#endif
+ dbg("bug: read_unlock");
rwlock->count--;
__spin_unlock(&rwlock->lock);
rwlock->count--;
__spin_unlock(&rwlock->lock);