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

Function thread1_task

test/test_transaction.py:206–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204 successes = []
205
206 def thread1_task() -> None:
207 try:
208 with testrepo.transaction() as txn:
209 txn.lock_ref(ref1_name)
210 thread1_ref1_locked.set()
211 thread2_ref2_locked.wait(timeout=5)
212 # this would cause a deadlock, so will throw (GitError)
213 txn.lock_ref(ref2_name)
214 # shouldn't get here
215 successes.append('thread1')
216 except Exception as e:
217 errors.append(('thread1', type(e).__name__, str(e)))
218
219 def thread2_task() -> None:
220 try:

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…