mirror of
https://github.com/systemd/systemd.git
synced 2025-02-28 05:57:33 +03:00
[PATCH] udev build tweaks to tdb's spinlock code
This commit is contained in:
parent
32ff5bca15
commit
1c386a909a
@ -21,7 +21,7 @@
|
|||||||
#define STANDALONE
|
#define STANDALONE
|
||||||
#define TDB_DEBUG
|
#define TDB_DEBUG
|
||||||
#define HAVE_MMAP 1
|
#define HAVE_MMAP 1
|
||||||
|
#include "../udev.h"
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -40,7 +40,6 @@
|
|||||||
#include "tdb.h"
|
#include "tdb.h"
|
||||||
#include "spinlock.h"
|
#include "spinlock.h"
|
||||||
|
|
||||||
#define DEBUG
|
|
||||||
#else
|
#else
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#endif
|
#endif
|
||||||
@ -299,10 +298,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");
|
dbg("bug: write_unlock");
|
||||||
#endif
|
|
||||||
|
|
||||||
rwlock->count &= ~RWLOCK_BIAS;
|
rwlock->count &= ~RWLOCK_BIAS;
|
||||||
__spin_unlock(&rwlock->lock);
|
__spin_unlock(&rwlock->lock);
|
||||||
@ -312,13 +309,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");
|
dbg("bug: read_unlock");
|
||||||
#endif
|
|
||||||
|
|
||||||
rwlock->count--;
|
rwlock->count--;
|
||||||
__spin_unlock(&rwlock->lock);
|
__spin_unlock(&rwlock->lock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user