From 5c86c7f35043f60e3ed6fead4839aa111ddbde57 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 24 Jan 2019 14:05:25 +0000 Subject: [PATCH] Updated to use CompositeLock --- openflexure_microscope/plugins/example/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openflexure_microscope/plugins/example/plugin.py b/openflexure_microscope/plugins/example/plugin.py index a0fb0538..a7e0c044 100644 --- a/openflexure_microscope/plugins/example/plugin.py +++ b/openflexure_microscope/plugins/example/plugin.py @@ -39,8 +39,10 @@ class Plugin(MicroscopePlugin): print("Starting a long-running task...") n_array = [] - print("Acquiring camera and stage locks...") - with self.microscope.camera.lock, self.microscope.stage.lock: + #print("Acquiring camera and stage locks...") + #with self.microscope.camera.lock, self.microscope.stage.lock: + print("Acquiring composite microscope lock...") + with self.microscope.lock: for _ in range(t_run): n_array.append(random.random()) time.sleep(1)