MCPcopy Create free account
hub / github.com/libgit2/pygit2 / thread2_task

Function thread2_task

test/test_transaction.py:219–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217 errors.append(('thread1', type(e).__name__, str(e)))
218
219 def thread2_task() -> None:
220 try:
221 with testrepo.transaction() as txn:
222 txn.lock_ref(ref2_name)
223 thread2_ref2_locked.set()
224 thread1_ref1_locked.wait(timeout=5)
225 # this would cause a deadlock, so will throw (GitError)
226 txn.lock_ref(ref2_name)
227 # shouldn't get here
228 successes.append('thread2')
229 except Exception as e:
230 errors.append(('thread2', type(e).__name__, str(e)))
231
232 thread1 = threading.Thread(target=thread1_task)
233 thread2 = threading.Thread(target=thread2_task)

Callers

nothing calls this directly

Calls 2

transactionMethod · 0.80
lock_refMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…