From 15d7c818765d5abc3560213e50be27e28530622b Mon Sep 17 00:00:00 2001 From: josePereiro Date: Fri, 3 Jan 2025 22:16:14 -0500 Subject: [PATCH] getlockfile.lk --- src/1.AbstractBlobBase/lock.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/1.AbstractBlobBase/lock.jl b/src/1.AbstractBlobBase/lock.jl index e3b70c4..6079f1c 100644 --- a/src/1.AbstractBlobBase/lock.jl +++ b/src/1.AbstractBlobBase/lock.jl @@ -32,8 +32,17 @@ function getlockfile(ab::AbstractBlob, args...) B = bloberia(ab) # filepath _file = _pidfile_path(ab, args...; B) - gettemp!(B, _file) do - return SimpleLockFile(_file) + # To avoid + # AssertionError: Multiple concurrent writes to Dict detected! + # Im locking the access to the getlockfile + # TODO: reseach about the best way to do this. + lk = gettemp!(B, "getlockfile.lk") do + ReentrantLock() + end + return lock(lk) do + gettemp!(B, _file) do + return SimpleLockFile(_file) + end end end