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

Method _check_thread

pygit2/transaction.py:64–72  ·  view source on GitHub ↗

Verify transaction is being used from the same thread that created it.

(self)

Source from the content-addressed store, hash-verified

62 self._tx = self._transaction[0]
63
64 def _check_thread(self) -> None:
65 """Verify transaction is being used from the same thread that created it."""
66 current_thread = threading.get_ident()
67 if current_thread != self._thread_id:
68 raise RuntimeError(
69 f'Transaction created in thread {self._thread_id} '
70 f'but used in thread {current_thread}. '
71 'Transactions must be used from the thread that created them.'
72 )
73
74 def lock_ref(self, refname: str) -> None:
75 """Lock a reference in preparation for updating it.

Callers 6

lock_refMethod · 0.95
set_targetMethod · 0.95
set_symbolic_targetMethod · 0.95
removeMethod · 0.95
commitMethod · 0.95
__exit__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected