* The rw_lock is now able to nest read/write locks when you have a write lock.

It follows the semantics of the BFS R/W lock, though, that is, if you unlock
  your write lock before the read locks, the read locks effectively become
  write locks, too.
* Added a mutex_transfer_lock() function that will allow you to unlock a mutex
  in a different thread than the one which locked it (only matters if KDEBUG
  is enabled, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26316 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-07-08 07:56:49 +00:00
parent f90a5e346d
commit 78b32dd026
5 changed files with 81 additions and 4 deletions
+10
View File
@@ -46,6 +46,7 @@ typedef struct rw_lock {
thread_id holder;
int32 reader_count;
int32 writer_count;
int32 owner_count;
uint32 flags;
} rw_lock;
@@ -159,6 +160,15 @@ mutex_unlock(mutex* lock)
}
static inline void
mutex_transfer_lock(mutex* lock, thread_id thread)
{
#ifdef KDEBUG
lock->holder = thread;
#endif
}
extern void lock_debug_init();
#ifdef __cplusplus