* 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:
@@ -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
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user