From 27043240f376013de21963f0e80d4164fc10b87d Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 24 Jan 2019 14:05:05 +0000 Subject: [PATCH] Added explicit lock ecquisition --- openflexure_microscope/api/v1/blueprints/stage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/api/v1/blueprints/stage.py b/openflexure_microscope/api/v1/blueprints/stage.py index 1b816150..a6a08d38 100644 --- a/openflexure_microscope/api/v1/blueprints/stage.py +++ b/openflexure_microscope/api/v1/blueprints/stage.py @@ -81,7 +81,9 @@ class PositionAPI(MicroscopeView): # Move if stage exists if self.microscope.stage: - self.microscope.stage.move_rel(position) + # Explicitally acquire lock + with self.microscope.stage.lock: + self.microscope.stage.move_rel(position) out = filter_dict(self.microscope.state, ('stage', 'position'))