Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
threading._Event Class Reference
Inheritance diagram for threading._Event:
Inheritance graph
[legend]
Collaboration diagram for threading._Event:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def is_set
def set
def clear
def wait

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 isSet = is_set

Private Member Functions

def _reset_internal_locks

Private Attributes

 _cond
 _flag

Detailed Description

Definition at line 385 of file threading.py.


Constructor & Destructor Documentation

def threading._Event.__init__ (   self,
  verbose = None 
)

Reimplemented from threading._Verbose.

Definition at line 389 of file threading.py.

00389 
00390     def __init__(self, verbose=None):
00391         _Verbose.__init__(self, verbose)
00392         self._cond = Condition(Lock())
00393         self._flag = False

Here is the caller graph for this function:


Member Function Documentation

def threading._Event._reset_internal_locks (   self) [private]

Definition at line 394 of file threading.py.

00394 
00395     def _reset_internal_locks(self):
00396         # private!  called by Thread._reset_internal_locks by _after_fork()
00397         self._cond.__init__()

def threading._Event.clear (   self)

Definition at line 411 of file threading.py.

00411 
00412     def clear(self):
00413         self._cond.acquire()
00414         try:
00415             self._flag = False
00416         finally:
00417             self._cond.release()

def threading._Event.is_set (   self)

Definition at line 398 of file threading.py.

00398 
00399     def is_set(self):
00400         return self._flag

def threading._Event.set (   self)

Definition at line 403 of file threading.py.

00403 
00404     def set(self):
00405         self._cond.acquire()
00406         try:
00407             self._flag = True
00408             self._cond.notify_all()
00409         finally:
00410             self._cond.release()

Here is the caller graph for this function:

def threading._Event.wait (   self,
  timeout = None 
)

Definition at line 418 of file threading.py.

00418 
00419     def wait(self, timeout=None):
00420         self._cond.acquire()
00421         try:
00422             if not self._flag:
00423                 self._cond.wait(timeout)
00424             return self._flag
00425         finally:
00426             self._cond.release()
00427 
00428 
00429 # A barrier class.  Inspired in part by the pthread_barrier_* api and
00430 # the CyclicBarrier class from Java.  See
00431 # http://sourceware.org/pthreads-win32/manual/pthread_barrier_init.html and
00432 # http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/
00433 #        CyclicBarrier.html
00434 # for information.
00435 # We maintain two main states, 'filling' and 'draining' enabling the barrier
00436 # to be cyclic.  Threads are not allowed into it until it has fully drained
00437 # since the previous cycle.  In addition, a 'resetting' state exists which is
00438 # similar to 'draining' except that threads leave with a BrokenBarrierError,
# and a 'broken' state in which all threads get get the exception.

Member Data Documentation

Definition at line 391 of file threading.py.

Definition at line 392 of file threading.py.

Definition at line 401 of file threading.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: