MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/threading.py:243–265  ·  view source on GitHub ↗
(self, lock=None)

Source from the content-addressed store, hash-verified

241 """
242
243 def __init__(self, lock=None):
244 if lock is None:
245 lock = RLock()
246 self._lock = lock
247 # Export the lock's acquire() and release() methods
248 self.acquire = lock.acquire
249 self.release = lock.release
250 # If the lock defines _release_save() and/or _acquire_restore(),
251 # these override the default implementations (which just call
252 # release() and acquire() on the lock). Ditto for _is_owned().
253 try:
254 self._release_save = lock._release_save
255 except AttributeError:
256 pass
257 try:
258 self._acquire_restore = lock._acquire_restore
259 except AttributeError:
260 pass
261 try:
262 self._is_owned = lock._is_owned
263 except AttributeError:
264 pass
265 self._waiters = _deque()
266
267 def _at_fork_reinit(self):
268 self._lock._at_fork_reinit()

Callers

nothing calls this directly

Calls 1

RLockFunction · 0.70

Tested by

no test coverage detected