Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
multiprocessing.dummy.Condition Class Reference
Inheritance diagram for multiprocessing.dummy.Condition:
Inheritance graph
[legend]
Collaboration diagram for multiprocessing.dummy.Condition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __enter__
def __exit__
def __repr__
def wait
def wait_for
def notify
def notify_all

Public Attributes

 acquire
 release
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 notify_all = threading._Condition.notify_all.__func__
 notifyAll = notify_all

Detailed Description

Definition at line 87 of file __init__.py.


Member Function Documentation

def threading._Condition.__enter__ (   self) [inherited]

Definition at line 203 of file threading.py.

00203 
00204     def __enter__(self):
00205         return self._lock.__enter__()

def threading._Condition.__exit__ (   self,
  args 
) [inherited]

Definition at line 206 of file threading.py.

00206 
00207     def __exit__(self, *args):
00208         return self._lock.__exit__(*args)

def threading._Condition.__repr__ (   self) [inherited]

Definition at line 209 of file threading.py.

00209 
00210     def __repr__(self):
00211         return "<Condition(%s, %d)>" % (self._lock, len(self._waiters))

def threading._Condition.notify (   self,
  n = 1 
) [inherited]

Definition at line 285 of file threading.py.

00285 
00286     def notify(self, n=1):
00287         if not self._is_owned():
00288             raise RuntimeError("cannot notify on un-acquired lock")
00289         __waiters = self._waiters
00290         waiters = __waiters[:n]
00291         if not waiters:
00292             if __debug__:
00293                 self._note("%s.notify(): no waiters", self)
00294             return
00295         self._note("%s.notify(): notifying %d waiter%s", self, n,
00296                    n!=1 and "s" or "")
00297         for waiter in waiters:
00298             waiter.release()
00299             try:
00300                 __waiters.remove(waiter)
00301             except ValueError:
00302                 pass

Here is the call graph for this function:

Here is the caller graph for this function:

def threading._Condition.notify_all (   self) [inherited]

Definition at line 303 of file threading.py.

00303 
00304     def notify_all(self):
00305         self.notify(len(self._waiters))

Here is the call graph for this function:

def threading._Condition.wait (   self,
  timeout = None 
) [inherited]

Definition at line 227 of file threading.py.

00227 
00228     def wait(self, timeout=None):
00229         if not self._is_owned():
00230             raise RuntimeError("cannot wait on un-acquired lock")
00231         waiter = _allocate_lock()
00232         waiter.acquire()
00233         self._waiters.append(waiter)
00234         saved_state = self._release_save()
00235         try:    # restore state no matter what (e.g., KeyboardInterrupt)
00236             if timeout is None:
00237                 waiter.acquire()
00238                 gotit = True
00239                 if __debug__:
00240                     self._note("%s.wait(): got it", self)
00241             else:
00242                 if timeout > 0:
00243                     gotit = waiter.acquire(True, timeout)
00244                 else:
00245                     gotit = waiter.acquire(False)
00246                 if not gotit:
00247                     if __debug__:
00248                         self._note("%s.wait(%s): timed out", self, timeout)
00249                     try:
00250                         self._waiters.remove(waiter)
00251                     except ValueError:
00252                         pass
00253                 else:
00254                     if __debug__:
00255                         self._note("%s.wait(%s): got it", self, timeout)
00256             return gotit
00257         finally:
00258             self._acquire_restore(saved_state)

Here is the call graph for this function:

Here is the caller graph for this function:

def threading._Condition.wait_for (   self,
  predicate,
  timeout = None 
) [inherited]

Definition at line 259 of file threading.py.

00259 
00260     def wait_for(self, predicate, timeout=None):
00261         endtime = None
00262         waittime = timeout
00263         result = predicate()
00264         while not result:
00265             if waittime is not None:
00266                 if endtime is None:
00267                     endtime = _time() + waittime
00268                 else:
00269                     waittime = endtime - _time()
00270                     if waittime <= 0:
00271                         if __debug__:
00272                             self._note("%s.wait_for(%r, %r): Timed out.",
00273                                        self, predicate, timeout)
00274                         break
00275             if __debug__:
00276                 self._note("%s.wait_for(%r, %r): Waiting with timeout=%s.",
00277                            self, predicate, timeout, waittime)
00278             self.wait(waittime)
00279             result = predicate()
00280         else:
00281             if __debug__:
00282                 self._note("%s.wait_for(%r, %r): Success.",
00283                            self, predicate, timeout)
00284         return result

Here is the call graph for this function:


Member Data Documentation

Definition at line 184 of file threading.py.

multiprocessing.dummy.Condition.notify_all = threading._Condition.notify_all.__func__ [static]

Definition at line 90 of file __init__.py.

Definition at line 306 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.

Definition at line 185 of file threading.py.


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