MCPcopy Create free account
hub / github.com/mlco2/codecarbon / thread_target

Method thread_target

tests/test_lock.py:57–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 )
56
57 def thread_target():
58 # Create a lock instance in each thread
59 lock = Lock()
60 try:
61 lock.acquire()
62 except Exception:
63 pass
64 finally:
65 lock.release()
66
67 threads = [threading.Thread(target=thread_target, args=()) for _ in range(10)]
68

Callers

nothing calls this directly

Calls 3

acquireMethod · 0.95
releaseMethod · 0.95
LockClass · 0.90

Tested by

no test coverage detected