MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / thread_1

Function thread_1

src/12/locking_with_deadlock_avoidance/example1.py:7–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5y_lock = threading.Lock()
6
7def thread_1():
8 while True:
9 with acquire(x_lock, y_lock):
10 print("Thread-1")
11
12def thread_2():
13 while True:

Callers

nothing calls this directly

Calls 1

acquireFunction · 0.90

Tested by

no test coverage detected