MCPcopy Index your code
hub / github.com/python/cpython / test_try_acquire_contended

Method test_try_acquire_contended

Lib/test/lock_tests.py:159–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

157 lock.release()
158
159 def test_try_acquire_contended(self):
160 lock = self.locktype()
161 lock.acquire()
162 result = []
163 def f():
164 result.append(lock.acquire(False))
165 with Bunch(f, 1):
166 pass
167 self.assertFalse(result[0])
168 lock.release()
169
170 def test_acquire_contended(self):
171 lock = self.locktype()

Callers

nothing calls this directly

Calls 4

assertFalseMethod · 0.80
BunchClass · 0.70
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected