Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz/python-cookbook
/ thread_2
Function
thread_2
src/12/locking_with_deadlock_avoidance/example2.py:16–21 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
14
time.sleep(1)
15
16
def
thread_2():
17
while
True:
18
with
acquire(y_lock):
19
with
acquire(x_lock):
20
print(
"Thread-2"
)
21
time.sleep(1)
22
23
input(
'This program crashes with an exception. Press [return] to start'
)
24
Callers
nothing calls this directly
Calls
1
acquire
Function · 0.90
Tested by
no test coverage detected