From a013c3fcaa10303a09bb15e1ae01a00ef7dca950 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Fri, 19 Jun 2026 16:36:40 +0200 Subject: [PATCH] fix: put mcs callback cm in rlock --- .../devices/epics/mcs_card/mcs_card_csaxs.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/csaxs_bec/devices/epics/mcs_card/mcs_card_csaxs.py b/csaxs_bec/devices/epics/mcs_card/mcs_card_csaxs.py index 85c0dcd..0ae2b15 100644 --- a/csaxs_bec/devices/epics/mcs_card/mcs_card_csaxs.py +++ b/csaxs_bec/devices/epics/mcs_card/mcs_card_csaxs.py @@ -68,13 +68,14 @@ def suppress_mca_callbacks(mcs_card: MCSCard, restore_after_timeout: None | floa clear the suppression after the specified time. If None, the original state is not restored. """ - mcs_card._omit_mca_callbacks.set() # pylint: disable=protected-access - try: - yield - finally: - if restore_after_timeout is not None: - time.sleep(restore_after_timeout) - mcs_card._omit_mca_callbacks.clear() # pylint: disable=protected-access + with mcs_card._rlock: + mcs_card._omit_mca_callbacks.set() # pylint: disable=protected-access + try: + yield + finally: + if restore_after_timeout is not None: + time.sleep(restore_after_timeout) + mcs_card._omit_mca_callbacks.clear() # pylint: disable=protected-access if TYPE_CHECKING: # pragma: no cover