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/example1.py:12–15 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
10
print(
"Thread-1"
)
11
12
def
thread_2():
13
while
True:
14
with
acquire(y_lock, x_lock):
15
print(
"Thread-2"
)
16
17
input(
'This program runs forever. Press [return] to start, Ctrl-C to exit'
)
18
Callers
nothing calls this directly
Calls
1
acquire
Function · 0.90
Tested by
no test coverage detected