2 * Copyright 2009 Colin Günther, coling@gmx.de
3 * All Rights Reserved. Distributed under the terms of the MIT License.
8 #include <compat/sys/condvar.h>
9 #include <compat/sys/kernel.h>
16 conditionInit(struct cv
* variable
, const char* description
)
18 variable
->condition
.Init(variable
, description
);
23 conditionPublish(struct cv
* variable
, const void* waitChannel
,
24 const char* description
)
26 variable
->condition
.Publish(waitChannel
, description
);
31 conditionUnpublish(struct cv
* variable
)
33 variable
->condition
.Unpublish();
38 conditionTimedWait(struct cv
* variable
, const int timeout
)
40 status_t status
= variable
->condition
.Wait(B_RELATIVE_TIMEOUT
,
41 ticks_to_usecs(timeout
));
50 conditionWait(struct cv
* variable
)
52 variable
->condition
.Wait();
57 conditionNotifyOne(struct cv
* variable
)
59 variable
->condition
.NotifyOne();
64 publishedConditionTimedWait(const void* waitChannel
, const int timeout
)
66 ConditionVariableEntry variableEntry
;
68 status_t status
= variableEntry
.Wait(waitChannel
, B_RELATIVE_TIMEOUT
,
69 ticks_to_usecs(timeout
));
78 publishedConditionNotifyAll(const void* waitChannel
)
80 ConditionVariable::NotifyAll(waitChannel
, B_OK
);