From 9f72175f2134185afdc35ece7580825ccdbe494c Mon Sep 17 00:00:00 2001 From: kngwyu Date: Thu, 8 Apr 2021 15:31:49 +0900 Subject: [PATCH] Use /tmp/hash-mujocopy-buildlock as an inter-process lockfile --- mujoco_py/builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mujoco_py/builder.py b/mujoco_py/builder.py index c2d5b727..81f11981 100644 --- a/mujoco_py/builder.py +++ b/mujoco_py/builder.py @@ -84,7 +84,8 @@ def load_cython_ext(mujoco_path): builder = Builder(mujoco_path) cext_so_path = builder.get_so_file_path() - lockpath = os.path.join(os.path.dirname(cext_so_path), 'mujocopy-buildlock') + cext_so_hash = hash(os.path.dirname(cext_so_path)) + lockpath = os.path.join("/tmp", f"{cext_so_hash}-mujocopy-buildlock") with fasteners.InterProcessLock(lockpath): mod = None