Some header work to reduce dependencies. Also fixes the debug build.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10434 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
/*
|
||||
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
** Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2002-2004, Axel Dörfler, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
* Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
#ifndef _KERNEL_LOCK_H
|
||||
#define _KERNEL_LOCK_H
|
||||
|
||||
@@ -9,22 +12,17 @@
|
||||
#include <OS.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
||||
typedef struct recursive_lock {
|
||||
sem_id sem;
|
||||
thread_id holder;
|
||||
int recursion;
|
||||
} recursive_lock;
|
||||
|
||||
#define ASSERT_LOCKED_RECURSIVE(r) { ASSERT(thread_get_current_thread_id() == (r)->holder); }
|
||||
|
||||
typedef struct mutex {
|
||||
sem_id sem;
|
||||
thread_id holder;
|
||||
} mutex;
|
||||
|
||||
#define ASSERT_LOCKED_MUTEX(m) { ASSERT(thread_get_current_thread_id() == (m)->holder); }
|
||||
|
||||
typedef struct benaphore {
|
||||
sem_id sem;
|
||||
int32 count;
|
||||
@@ -41,6 +39,12 @@ typedef struct rw_lock {
|
||||
|
||||
#define RW_MAX_READERS 1000000
|
||||
|
||||
#ifdef DEBUG
|
||||
# include <thread.h>
|
||||
#endif
|
||||
#define ASSERT_LOCKED_RECURSIVE(r) { ASSERT(thread_get_current_thread_id() == (r)->holder); }
|
||||
#define ASSERT_LOCKED_MUTEX(m) { ASSERT(thread_get_current_thread_id() == (m)->holder); }
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user