MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __init__

Method __init__

pager_lib/tqdm/std.py:90–100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88 th_lock = TRLock()
89
90 def __init__(self):
91 # Create global parallelism locks to avoid racing issues with parallel
92 # bars works only if fork available (Linux/MacOSX, but not Windows)
93 cls = type(self)
94 root_lock = cls.th_lock
95 if root_lock is not None:
96 root_lock.acquire()
97 cls.create_mp_lock()
98 self.locks = [lk for lk in [cls.mp_lock, cls.th_lock] if lk is not None]
99 if root_lock is not None:
100 root_lock.release()
101
102 def acquire(self, *a, **k):
103 for lock in self.locks:

Callers

nothing calls this directly

Calls 3

acquireMethod · 0.80
create_mp_lockMethod · 0.80
releaseMethod · 0.80

Tested by

no test coverage detected