Added macros for static initialization of mutexes, recursive locks, and
R/W locks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25691 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -62,6 +62,18 @@ typedef struct rw_lock {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// static initializers
|
||||||
|
#ifdef KDEBUG
|
||||||
|
# define MUTEX_INITIALIZER(name) { name, NULL, -1, 0 }
|
||||||
|
# define RECURSIVE_LOCK_INITIALIZER(name) { MUTEX_INITIALIZER(name), 0 }
|
||||||
|
#else
|
||||||
|
# define MUTEX_INITIALIZER(name) { name, NULL, 0, 0 }
|
||||||
|
# define RECURSIVE_LOCK_INITIALIZER(name) { MUTEX_INITIALIZER(name), -1, 0 }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define RW_LOCK_INITIALIZER(name) { name, NULL, -1, 0, 0, 0 }
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user