up: THREAD     index Zimbu documentation

CLASS T.cond @public

summary

     

The builtin type cond: An object to wait on a condition.

Useful in multi-threading applications. A Cond object can be used for a thread to wait on a condition to be changed in another thread.

NEW() @public  Create a new condition. It can be used for anything.
$wakeup(all) @public  Wakeup threads blocked in wait() on this Cond object.
$wait(lock) @public  Wait for another thread to call wakeup() on this Cond object.
 

members (alphabetically)

     

PROC NEW() @public

     

Create a new condition. It can be used for anything.

PROC $wait(THREAD.Lock lock) @public

     

Wait for another thread to call wakeup() on this Cond object.

lock is used do the blocking wait. It must be owned when called. It is released while waiting. It is locked again when this method returns.

PROC $wakeup(bool all) @public

     

Wakeup threads blocked in wait() on this Cond object.

When all is TRUE wakeup all threads, otherwise only one.

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0