/synch/condition.d
http://github.com/wilkie/djehuty · D · 44 lines · 24 code · 11 blank · 9 comment · 0 complexity · ac10664bbab0cdbd4f8ba137abe80f51 MD5 · raw file
- /*
- * condition.d
- *
- * This module implements a conditional wait object.
- *
- * Author: Dave Wilkinson
- * Originated: December 4th, 2009
- *
- */
- module synch.condition;
- import platform.vars.mutex;
- import platform.vars.condition;
- import scaffold.thread;
- import synch.mutex;
- class Condition {
- this() {
- ConditionInit(_pfvars);
- }
- void signal() {
- ConditionSignal(_pfvars);
- }
- void wait() {
- ConditionWait(_pfvars);
- }
- package:
- void wait(ref MutexPlatformVars mutexVars) {
- ConditionWait(_pfvars, mutexVars);
- }
- ConditionPlatformVars _pfvars;
- }
- interface Waitable {
- Condition waitCondition();
- }