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

Function thread_1

src/12/locking_with_deadlock_avoidance/example2.py:9–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7y_lock = threading.Lock()
8
9def thread_1():
10 while True:
11 with acquire(x_lock):
12 with acquire(y_lock):
13 print("Thread-1")
14 time.sleep(1)
15
16def thread_2():
17 while True:

Callers

nothing calls this directly

Calls 1

acquireFunction · 0.90

Tested by

no test coverage detected