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)
| 124 | Lock = _LockType |
| 125 | |
| 126 | def 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 | |
| 146 | class _RLock: |
| 147 | """This class implements reentrant lock objects. |
no test coverage detected