They're already in druntime for D2, though they haven't been distributed yet (dunno why). And they can act like they're built in:

class C
{
    Mutex     m;
    Condition c;

    this()
    {
        // make m this object's monitor
        m = new Mutex( this );
        c = new Condition( m );
    }

    synchronized void foo()
    {
        // m is locked
        c.notify();
    }
}

Reply via email to