Implement hardware locks
This commit is contained in:
parent
a40cb9b9f6
commit
8292ebf7c7
10 changed files with 268 additions and 170 deletions
|
|
@ -39,10 +39,12 @@ class Plugin(MicroscopePlugin):
|
|||
print("Starting a long-running task...")
|
||||
n_array = []
|
||||
|
||||
for _ in range(t_run):
|
||||
n_array.append(random.random())
|
||||
time.sleep(1)
|
||||
print("Acquiring camera lock...")
|
||||
with self.microscope.camera.lock:
|
||||
for _ in range(t_run):
|
||||
n_array.append(random.random())
|
||||
time.sleep(1)
|
||||
|
||||
print("Long-running task finished!")
|
||||
print("Long-running task finished! Releasing lock.")
|
||||
|
||||
return n_array
|
||||
Loading…
Add table
Add a link
Reference in a new issue