Added a BenaphoreLocker.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12380 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -196,10 +196,28 @@ public:
|
|||||||
// RecursiveLocker
|
// RecursiveLocker
|
||||||
typedef AutoLocker<recursive_lock, RecursiveLockLocking> 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
|
} // namespace BPrivate
|
||||||
|
|
||||||
using BPrivate::AutoLocker;
|
using BPrivate::AutoLocker;
|
||||||
using BPrivate::MutexLocker;
|
using BPrivate::MutexLocker;
|
||||||
using BPrivate::RecursiveLocker;
|
using BPrivate::RecursiveLocker;
|
||||||
|
using BPrivate::BenaphoreLocker;
|
||||||
|
|
||||||
#endif // KERNEL_UTIL_AUTO_LOCKER_H
|
#endif // KERNEL_UTIL_AUTO_LOCKER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user