* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36218 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c944d11f7e
commit
ef9dbf80c1
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2001-2007, Haiku, Inc. All Rights Reserved.
|
* Copyright 2001-2010, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _LOCKER_H
|
#ifndef _LOCKER_H
|
||||||
|
@ -10,36 +10,39 @@
|
||||||
|
|
||||||
|
|
||||||
class BLocker {
|
class BLocker {
|
||||||
public:
|
public:
|
||||||
BLocker();
|
BLocker();
|
||||||
BLocker(const char* name);
|
BLocker(const char* name);
|
||||||
BLocker(bool benaphoreStyle);
|
BLocker(bool benaphoreStyle);
|
||||||
BLocker(const char* name, bool benaphoreStyle);
|
BLocker(const char* name, bool benaphoreStyle);
|
||||||
virtual ~BLocker();
|
virtual ~BLocker();
|
||||||
|
|
||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
|
|
||||||
bool Lock(void);
|
bool Lock();
|
||||||
status_t LockWithTimeout(bigtime_t timeout);
|
status_t LockWithTimeout(bigtime_t timeout);
|
||||||
void Unlock(void);
|
void Unlock();
|
||||||
|
|
||||||
thread_id LockingThread(void) const;
|
thread_id LockingThread() const;
|
||||||
bool IsLocked(void) const;
|
bool IsLocked() const;
|
||||||
int32 CountLocks(void) const;
|
int32 CountLocks() const;
|
||||||
int32 CountLockRequests(void) const;
|
int32 CountLockRequests() const;
|
||||||
sem_id Sem(void) const;
|
sem_id Sem() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BLocker(const char *name, bool benaphoreStyle, bool);
|
BLocker(const char* name, bool benaphoreStyle,
|
||||||
void InitLocker(const char *name, bool benaphore_style);
|
bool _ignored);
|
||||||
bool AcquireLock(bigtime_t timeout, status_t *error);
|
void InitLocker(const char* name,
|
||||||
|
bool benaphoreStyle);
|
||||||
|
bool AcquireLock(bigtime_t timeout, status_t* error);
|
||||||
|
|
||||||
int32 fBenaphoreCount;
|
int32 fBenaphoreCount;
|
||||||
sem_id fSemaphoreID;
|
sem_id fSemaphoreID;
|
||||||
thread_id fLockOwner;
|
thread_id fLockOwner;
|
||||||
int32 fRecursiveCount;
|
int32 fRecursiveCount;
|
||||||
|
|
||||||
int32 _reserved[4];
|
int32 _reserved[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _LOCKER_H
|
|
||||||
|
#endif // _LOCKER_H
|
||||||
|
|
Loading…
Reference in New Issue