* 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
@@ -993,6 +993,7 @@
#define mutex_lock fssh_mutex_lock
#define mutex_trylock fssh_mutex_trylock
#define mutex_unlock fssh_mutex_unlock
#define mutex_transfer_lock fssh_mutex_transfer_lock
////////////////////////////////////////////////////////////////////////////////
+2
View File
@@ -32,6 +32,7 @@ typedef struct fssh_recursive_lock {
typedef struct fssh_rw_lock {
fssh_sem_id sem;
fssh_thread_id holder;
int32_t count;
} fssh_rw_lock;
@@ -75,6 +76,7 @@ extern void fssh_mutex_destroy(fssh_mutex* lock);
extern fssh_status_t fssh_mutex_lock(fssh_mutex* lock);
extern fssh_status_t fssh_mutex_trylock(fssh_mutex* lock);
extern void fssh_mutex_unlock(fssh_mutex* lock);
extern void fssh_mutex_transfer_lock(fssh_mutex* lock, fssh_thread_id thread);
#ifdef __cplusplus
}