diff options
| author | Christian Kolset <ckolset@colostate.edu> | 2026-07-27 17:34:30 -0600 |
|---|---|---|
| committer | Christian Kolset <ckolset@colostate.edu> | 2026-07-27 17:34:30 -0600 |
| commit | ee4965f4d4d1fc5d40be24b99341620e32386d40 (patch) | |
| tree | 0dbafaa8aee899895b974ade9c9a2c7b66918701 /api_layers/protocols/base_protocol.py | |
| parent | c3f07a7ffa320aecb3fca5dd40e7644424bddfb5 (diff) | |
Enhance protocol layers: implement I/O locking for thread safety in serial communication
Diffstat (limited to 'api_layers/protocols/base_protocol.py')
| -rw-r--r-- | api_layers/protocols/base_protocol.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/api_layers/protocols/base_protocol.py b/api_layers/protocols/base_protocol.py index 096151d..bb45d6b 100644 --- a/api_layers/protocols/base_protocol.py +++ b/api_layers/protocols/base_protocol.py @@ -30,6 +30,7 @@ class BaseProtocol(ABC): self._cache: Dict[str, float] = {} self._lock = threading.Lock() + self._io_lock = threading.Lock() # guards self._ser — shared by poll thread and write() callers self._running = False self._thread: Optional[threading.Thread] = None self._ser = None |
