kill-threadPortable Threadsmake-lockmake-condition-variableGoTo Top

make-condition-variable   &rest initargs &key class lock => condition-variable[Function]

Purpose
Create a new condition variable.

Package   :portable-threads

Module   :portable-threads

Arguments and values

initargs     An initialization argument list
class     The name of the class for the created condition-variable instance (default is condition-variable)
lock     A lock, a recursive lock, or a condition variable (default is a non-recursive lock)
condition-variable     A condition variable

Returns
The created condition-variable.

See also
    make-instance
    make-lock
    make-recursive-lock
    with-lock-held
    without-lock-held

Examples
Make a condition-variable instance with a non-recursive lock:

  > (make-condition-variable)
  #<condition-variable>
  >
Make a condition-variable instance with a recursive lock:
  > (make-condition-variable :lock (make-recursive-lock))
  #<condition-variable>
  >
Define a subclass of condition-variable that includes a state slot:
  (defclass state-cv (condition-variable)
    ((state :initarg :state
            :initform nil
            :accessor state-of)))
and then create a state-cv instance with a recursive lock:
  > (make-condition-variable :class 'state-cv
                             :lock (make-recursive-lock))
  #<state-cv>
  >

Note
The make-condition-variable function is equivalent to using make-instance with the desired class for the created condition-variable instance. However, using make-condition-variable is preferable stylistically.


The GBBopen Project


kill-threadPortable Threadsmake-lockmake-condition-variableGoTo Top