threading :: _Condition :: Class _Condition
[hide private]
[frames] | no frames]

Class _Condition

source code

object --+    
         |    
  _Verbose --+
             |
            _Condition

Condition variables allow one or more threads to wait until they are notified by another thread.

Instance Methods [hide private]
 
__enter__(self) source code
 
__exit__(self, *args) source code
 
__init__(self, lock=None, verbose=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
_acquire_restore(self, x) source code
 
_is_owned(self) source code
 
_release_save(self) source code
 
notify(self, n=1)
Wake up one or more threads waiting on this condition, if any.
source code
 
notifyAll(self)
Wake up all threads waiting on this condition.
source code
 
notify_all(self)
Wake up all threads waiting on this condition.
source code
 
wait(self, timeout=None)
Wait until notified or until a timeout occurs.
source code

Inherited from _Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, lock=None, verbose=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

notify(self, n=1)

source code 

Wake up one or more threads waiting on this condition, if any.

If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.

This method wakes up at most n of the threads waiting for the condition variable; it is a no-op if no threads are waiting.

notifyAll(self)

source code 

Wake up all threads waiting on this condition.

If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.

notify_all(self)

source code 

Wake up all threads waiting on this condition.

If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.

wait(self, timeout=None)

source code 

Wait until notified or until a timeout occurs.

If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised.

This method releases the underlying lock, and then blocks until it is awakened by a notify() or notifyAll() call for the same condition variable in another thread, or until the optional timeout occurs. Once awakened or timed out, it re-acquires the lock and returns.

When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof).

When the underlying lock is an RLock, it is not released using its release() method, since this may not actually unlock the lock when it was acquired multiple times recursively. Instead, an internal interface of the RLock class is used, which really unlocks it even when it has been recursively acquired several times. Another internal interface is then used to restore the recursion level when the lock is reacquired.