D Programming Language 2.0

# core.sync.condition

The condition module provides a primitive for synchronized condition checking.

License:
Boost License 1.0

Authors:
Sean Kelly

Source:
core/sync/condition.d

class Condition;
  This class represents a condition variable as conceived by C.A.R. Hoare. As per Mesa type monitors however, "signal" has been replaced with "notify" to indicate that control is not transferred to the waiter when a notification is sent.

  this(Mutex m);
    Initializes a condition object which is associated with the supplied mutex object.

    Parameters:

    Mutex m | The mutex with which this condition will be associated.

    Throws:
    SyncException on error.

  @property Mutex mutex();
    Gets the mutex associated with this condition.

    Returns:
    The mutex associated with this condition.

  void wait();
    Wait until notified.

    Throws:
    SyncException on error.

  bool wait(Duration val);
    Suspends the calling thread until a notification occurs or until the supplied time period has elapsed.

    Parameters:

    Duration val | The time to wait.

    In:
    val must be non-negative.

    Throws:
    SyncException on error.

    Returns:
    true if notified before the timeout and false if not.

  void notify();
    Notifies one waiter.

    Throws:
    SyncException on error.

  void notifyAll();
    Notifies all waiters.

    Throws:
    SyncException on error.

Copyright Sean Kelly 2005 - 2009. | Page generated by Ddoc.