Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
_RLock Class Reference
Inheritance diagram for _RLock:
_Verbose

Public Member Functions

def __init__
 
def __repr__
 
def acquire
 
def release
 
- Public Member Functions inherited from _Verbose
def __init__
 
def __init__
 

Detailed Description

Definition at line 67 of file threading.py.

Constructor & Destructor Documentation

def __init__ (   self,
  verbose = None 
)

Definition at line 69 of file threading.py.

References _RLock.__block, _RLock.__count, _RLock.__owner, and threading._allocate_lock.

69 
70  def __init__(self, verbose=None):
71  _Verbose.__init__(self, verbose)
72  self.__block = _allocate_lock()
73  self.__owner = None
74  self.__count = 0

Member Function Documentation

def __repr__ (   self)

Definition at line 75 of file threading.py.

References _RLock.__count, and _RLock.__owner.

75 
76  def __repr__(self):
77  return "<%s(%s, %d)>" % (
78  self.__class__.__name__,
79  self.__owner and self.__owner.getName(),
80  self.__count)
def acquire (   self,
  blocking = 1 
)

Definition at line 81 of file threading.py.

References _RLock.__count, _RLock.__owner, _Verbose._note(), and threading.currentThread().

81 
82  def acquire(self, blocking=1):
83  me = currentThread()
84  if self.__owner is me:
85  self.__count = self.__count + 1
86  if __debug__:
87  self._note("%s.acquire(%s): recursive success", self, blocking)
88  return 1
89  rc = self.__block.acquire(blocking)
90  if rc:
91  self.__owner = me
92  self.__count = 1
93  if __debug__:
94  self._note("%s.acquire(%s): initial succes", self, blocking)
95  else:
96  if __debug__:
97  self._note("%s.acquire(%s): failure", self, blocking)
98  return rc
def release (   self)

Definition at line 99 of file threading.py.

References _RLock.__count, _RLock.__owner, _Verbose._note(), and threading.currentThread().

99 
100  def release(self):
101  me = currentThread()
102  assert self.__owner is me, "release() of un-acquire()d lock"
103  self.__count = count = self.__count - 1
104  if not count:
105  self.__owner = None
106  self.__block.release()
107  if __debug__:
108  self._note("%s.release(): final release", self)
109  else:
110  if __debug__:
111  self._note("%s.release(): non-final release", self)

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