Added a BenaphoreLocker.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12380 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
49ea5b1684
commit
3e15f83d9e
@ -196,10 +196,28 @@ public:
|
||||
// RecursiveLocker
|
||||
typedef AutoLocker<recursive_lock, RecursiveLockLocking> RecursiveLocker;
|
||||
|
||||
// BenaphoreLocking
|
||||
class BenaphoreLocking {
|
||||
public:
|
||||
inline bool Lock(benaphore *lockable)
|
||||
{
|
||||
return benaphore_lock(lockable) == B_OK;
|
||||
}
|
||||
|
||||
inline void Unlock(benaphore *lockable)
|
||||
{
|
||||
benaphore_unlock(lockable);
|
||||
}
|
||||
};
|
||||
|
||||
// BenaphoreLocker
|
||||
typedef AutoLocker<benaphore, BenaphoreLocking> BenaphoreLocker;
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
using BPrivate::AutoLocker;
|
||||
using BPrivate::MutexLocker;
|
||||
using BPrivate::RecursiveLocker;
|
||||
using BPrivate::BenaphoreLocker;
|
||||
|
||||
#endif // KERNEL_UTIL_AUTO_LOCKER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user