* Introduced a new locking primitive I called "cutex" (sorry for the
name, couldn't resist :-P). It's semantically equivalent to a mutex, but doesn't need a semaphore (it uses thread blocking and a simple queue instead). Initialization can't fail. In fact it is ready to use without initialization when living in the bss segment, also in the early boot process. It's as fast as a benaphore in cases of low lock contention, and faster otherwise. Only disadvantage is the higher immediate memory footprint of 16 bytes. * Changed how the "thread" and "threads" debugger commands list the objects they are waiting for. Cutexes are also included. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25276 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -67,6 +67,24 @@ public:
|
||||
// BenaphoreLocker
|
||||
typedef AutoLocker<benaphore, BenaphoreLocking> BenaphoreLocker;
|
||||
|
||||
// CutexLocking
|
||||
class CutexLocking {
|
||||
public:
|
||||
inline bool Lock(cutex *lockable)
|
||||
{
|
||||
cutex_lock(lockable);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void Unlock(cutex *lockable)
|
||||
{
|
||||
cutex_unlock(lockable);
|
||||
}
|
||||
};
|
||||
|
||||
// CutexLocker
|
||||
typedef AutoLocker<cutex, CutexLocking> CutexLocker;
|
||||
|
||||
// InterruptsLocking
|
||||
class InterruptsLocking {
|
||||
public:
|
||||
@@ -153,6 +171,7 @@ using BPrivate::AutoLocker;
|
||||
using BPrivate::MutexLocker;
|
||||
using BPrivate::RecursiveLocker;
|
||||
using BPrivate::BenaphoreLocker;
|
||||
using BPrivate::CutexLocker;
|
||||
using BPrivate::InterruptsLocker;
|
||||
using BPrivate::SpinLocker;
|
||||
using BPrivate::InterruptsSpinLocker;
|
||||
|
||||
Reference in New Issue
Block a user