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

Class _Event

source code

object --+    
         |    
  _Verbose --+
             |
            _Event

A factory function that returns a new event object. An event manages a flag that can be set to true with the set() method and reset to false with the clear() method. The wait() method blocks until the flag is true.

Instance Methods [hide private]
 
__init__(self, verbose=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_reset_internal_locks(self) source code
 
clear(self)
Reset the internal flag to false.
source code
 
isSet(self)
Return true if and only if the internal flag is true.
source code
 
is_set(self)
Return true if and only if the internal flag is true.
source code
 
set(self)
Set the internal flag to true.
source code
 
wait(self, timeout=None)
Block until the internal flag is true.
source code

Inherited from _Verbose (private): _note

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, verbose=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

clear(self)

source code 

Reset the internal flag to false.

Subsequently, threads calling wait() will block until set() is called to set the internal flag to true again.

set(self)

source code 

Set the internal flag to true.

All threads waiting for the flag to become true are awakened. Threads that call wait() once the flag is true will not block at all.

wait(self, timeout=None)

source code 

Block until the internal flag is true.

If the internal flag is true on entry, return immediately. Otherwise, block until another thread calls set() to set the flag to true, or until the optional timeout occurs.

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).

This method returns the internal flag on exit, so it will always return True except if a timeout is given and the operation times out.