Back to index

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

List of all members.

Public Member Functions

def __init__
def __repr__
def acquire
def release
def __exit__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Member Functions

def _acquire_restore
def _release_save
def _is_owned

Private Attributes

 _block
 _owner
 _count

Static Private Attributes

 __enter__ = acquire

Detailed Description

Definition at line 96 of file threading.py.


Constructor & Destructor Documentation

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

Reimplemented from threading._Verbose.

Definition at line 98 of file threading.py.

00098 
00099     def __init__(self, verbose=None):
00100         _Verbose.__init__(self, verbose)
00101         self._block = _allocate_lock()
00102         self._owner = None
00103         self._count = 0

Here is the caller graph for this function:


Member Function Documentation

def threading._RLock.__exit__ (   self,
  t,
  v,
  tb 
)

Definition at line 146 of file threading.py.

00146 
00147     def __exit__(self, t, v, tb):
00148         self.release()

Here is the call graph for this function:

def threading._RLock.__repr__ (   self)

Definition at line 104 of file threading.py.

00104 
00105     def __repr__(self):
00106         owner = self._owner
00107         try:
00108             owner = _active[owner].name
00109         except KeyError:
00110             pass
00111         return "<%s owner=%r count=%d>" % (
00112                 self.__class__.__name__, owner, self._count)

def threading._RLock._acquire_restore (   self,
  state 
) [private]

Definition at line 151 of file threading.py.

00151 
00152     def _acquire_restore(self, state):
00153         self._block.acquire()
00154         self._count, self._owner = state
00155         if __debug__:
00156             self._note("%s._acquire_restore()", self)

Here is the call graph for this function:

def threading._RLock._is_owned (   self) [private]

Definition at line 167 of file threading.py.

00167 
00168     def _is_owned(self):
00169         return self._owner == _get_ident()

def threading._RLock._release_save (   self) [private]

Definition at line 157 of file threading.py.

00157 
00158     def _release_save(self):
00159         if __debug__:
00160             self._note("%s._release_save()", self)
00161         count = self._count
00162         self._count = 0
00163         owner = self._owner
00164         self._owner = None
00165         self._block.release()
00166         return (count, owner)

Here is the call graph for this function:

def threading._RLock.acquire (   self,
  blocking = True,
  timeout = -1 
)

Definition at line 113 of file threading.py.

00113 
00114     def acquire(self, blocking=True, timeout=-1):
00115         me = _get_ident()
00116         if self._owner == me:
00117             self._count = self._count + 1
00118             if __debug__:
00119                 self._note("%s.acquire(%s): recursive success", self, blocking)
00120             return 1
00121         rc = self._block.acquire(blocking, timeout)
00122         if rc:
00123             self._owner = me
00124             self._count = 1
00125             if __debug__:
00126                 self._note("%s.acquire(%s): initial success", self, blocking)
00127         else:
00128             if __debug__:
00129                 self._note("%s.acquire(%s): failure", self, blocking)
00130         return rc

Here is the call graph for this function:

Here is the caller graph for this function:

def threading._RLock.release (   self)

Definition at line 133 of file threading.py.

00133 
00134     def release(self):
00135         if self._owner != _get_ident():
00136             raise RuntimeError("cannot release un-acquired lock")
00137         self._count = count = self._count - 1
00138         if not count:
00139             self._owner = None
00140             self._block.release()
00141             if __debug__:
00142                 self._note("%s.release(): final release", self)
00143         else:
00144             if __debug__:
00145                 self._note("%s.release(): non-final release", self)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

threading._RLock.__enter__ = acquire [static, private]

Definition at line 131 of file threading.py.

Definition at line 100 of file threading.py.

Definition at line 102 of file threading.py.

Definition at line 101 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: