ConditionVariable: add classical wait interface with lockable

Change-Id: Id18264e786dba818138caf3908c7a89b18e2a1dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4921
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
X512
2022-02-02 19:45:27 +00:00
committed by waddlesplash
parent 32fd04c959
commit d03e5994ee
2 changed files with 48 additions and 0 deletions
@@ -17,6 +17,8 @@
#include <util/OpenHashTable.h>
struct mutex;
struct recursive_lock;
struct ConditionVariable;
@@ -72,6 +74,9 @@ public:
status_t Wait(uint32 flags = 0, bigtime_t timeout = 0);
// all-in one, i.e. doesn't need a
// ConditionVariableEntry
status_t Wait(mutex* lock, uint32 flags = 0, bigtime_t timeout = 0);
status_t Wait(recursive_lock* lock, uint32 flags = 0, bigtime_t timeout = 0);
status_t Wait(spinlock* lock, uint32 flags = 0, bigtime_t timeout = 0);
const void* Object() const { return fObject; }
const char* ObjectType() const { return fObjectType; }