Skip to content

Commit a881ab2

Browse files
committed
Create a lock before acquiring.
1 parent cb21d09 commit a881ab2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/somd2/runner/_runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ def generate_lam_vals(lambda_base, increment=0.001):
938938
# Calculate the speed in nanoseconds per day.
939939
speed = time.to("ns") / days
940940

941+
# Create the lock.
942+
lock = _FileLock(self._lock_file)
943+
941944
# Acquire the file lock to ensure that the checkpoint files are
942945
# in a consistent state if read by another process.
943946
with lock.acquire(timeout=self._config.timeout.to("seconds")):

0 commit comments

Comments
 (0)