Skip to content

Commit

Permalink
fragmenter: reinstate RLock to mutex conn for TX
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 21, 2023
1 parent da15b0a commit 0b54c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pylibschc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
__copyright__ = "Copyright 2023 Freie Universität Berlin"
__license__ = "GPLv3"
__email__ = "[email protected]"
__version__ = "0.2.0b0"
__version__ = "0.2.0b1"
6 changes: 4 additions & 2 deletions pylibschc/fragmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ def __init__( # pylint: disable=too-many-arguments
self.mode = mode
self._conn = self.conn_cls(ops=self)
self._init_tx = False
self._tx_conn_lock = threading.Lock()
self._tx_conn_lock = threading.RLock()
self._rx_conn_lock = threading.Lock()

def _tx_conn_release(self):
self._init_tx = False
self._conn.reset()
if self._tx_conn_lock.locked(): # pragma: no cover
try:
self._tx_conn_lock.release()
except RuntimeError:
pass

def _end_fragmentation_tx(self, conn: FragmentationConnection):
if self._real_end_tx: # pragma: no cover
Expand Down

0 comments on commit 0b54c38

Please sign in to comment.