Back to index

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

List of all members.

Public Member Functions

def __init__
def get_value
def __repr__
def __enter__
def __exit__
def __getstate__
def __setstate__

Public Attributes

 acquire
 release
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 108 of file synchronize.py.


Constructor & Destructor Documentation

def multiprocessing.synchronize.Semaphore.__init__ (   self,
  value = 1 
)

Reimplemented in multiprocessing.synchronize.BoundedSemaphore.

Definition at line 110 of file synchronize.py.

00110 
00111     def __init__(self, value=1):
00112         SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 88 of file synchronize.py.

00088 
00089     def __enter__(self):
00090         return self._semlock.__enter__()

def multiprocessing.synchronize.SemLock.__exit__ (   self,
  args 
) [inherited]

Definition at line 91 of file synchronize.py.

00091 
00092     def __exit__(self, *args):
00093         return self._semlock.__exit__(*args)

Here is the caller graph for this function:

Definition at line 94 of file synchronize.py.

00094 
00095     def __getstate__(self):
00096         assert_spawning(self)
00097         sl = self._semlock
00098         return (Popen.duplicate_for_child(sl.handle), sl.kind, sl.maxvalue)

Here is the call graph for this function:

Reimplemented in multiprocessing.synchronize.BoundedSemaphore.

Definition at line 116 of file synchronize.py.

00116 
00117     def __repr__(self):
00118         try:
00119             value = self._semlock._get_value()
00120         except Exception:
00121             value = 'unknown'
00122         return '<Semaphore(value=%s)>' % value
00123 
00124 #
00125 # Bounded semaphore
00126 #

def multiprocessing.synchronize.SemLock.__setstate__ (   self,
  state 
) [inherited]

Definition at line 99 of file synchronize.py.

00099 
00100     def __setstate__(self, state):
00101         self._semlock = _multiprocessing.SemLock._rebuild(*state)
00102         debug('recreated blocker with handle %r' % state[0])
00103         self._make_methods()
00104 
00105 #
00106 # Semaphore
00107 #

Here is the call graph for this function:

Definition at line 113 of file synchronize.py.

00113 
00114     def get_value(self):
00115         return self._semlock._get_value()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 85 of file synchronize.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 86 of file synchronize.py.


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