* 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:
Axel Dörfler
2009-10-18 19:52:09 +00:00
parent b2a7fcb404
commit 22ea088498
2 changed files with 23 additions and 7 deletions
+3 -1
View File
@@ -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