MCPcopy Index your code
hub / github.com/RustPython/RustPython / RLock

Function RLock

Lib/threading.py:126–144  ·  view source on GitHub ↗

Factory function that returns a new reentrant lock. A reentrant lock must be released by the thread that acquired it. Once a thread has acquired a reentrant lock, the same thread may acquire it again without blocking; the thread must release it once for each time it has acquired it.

(*args, **kwargs)

Source from the content-addressed store, hash-verified

124Lock = _LockType
125
126def RLock(*args, **kwargs):
127 """Factory function that returns a new reentrant lock.
128
129 A reentrant lock must be released by the thread that acquired it. Once a
130 thread has acquired a reentrant lock, the same thread may acquire it again
131 without blocking; the thread must release it once for each time it has
132 acquired it.
133
134 """
135 if args or kwargs:
136 import warnings
137 warnings.warn(
138 'Passing arguments to RLock is deprecated and will be removed in 3.15',
139 DeprecationWarning,
140 stacklevel=2,
141 )
142 if _CRLock is None:
143 return _PyRLock(*args, **kwargs)
144 return _CRLock(*args, **kwargs)
145
146class _RLock:
147 """This class implements reentrant lock objects.

Callers 7

__init__Method · 0.90
__init__Method · 0.90
__new__Method · 0.90
NonCallableMockClass · 0.90
__init__Method · 0.70
threading.pyFile · 0.70
_after_forkFunction · 0.70

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected