* The rw_lock is now using a mutex to protect its reader/writer counts. This
makes the reader case a lot less expensive, and should relieve the thread spinlock contention a bit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33643 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -42,6 +42,7 @@ struct rw_lock_waiter;
|
||||
|
||||
typedef struct rw_lock {
|
||||
const char* name;
|
||||
mutex lock;
|
||||
struct rw_lock_waiter* waiters;
|
||||
thread_id holder;
|
||||
int32 reader_count;
|
||||
@@ -85,7 +86,8 @@ typedef struct rw_lock {
|
||||
# define RECURSIVE_LOCK_INITIALIZER(name) { MUTEX_INITIALIZER(name), -1, 0 }
|
||||
#endif
|
||||
|
||||
#define RW_LOCK_INITIALIZER(name) { name, NULL, -1, 0, 0, 0 }
|
||||
#define RW_LOCK_INITIALIZER(name) { name, MUTEX_INITIALIZER(name), \
|
||||
NULL, -1, 0, 0, 0 }
|
||||
|
||||
|
||||
#if KDEBUG
|
||||
|
||||
Reference in New Issue
Block a user