diff --git a/pyopencl/cache.py b/pyopencl/cache.py index fd46dc5c88fd85b3731f5758d38ee56492f9f69e..b6d21f280d6295d60cc0d88f229e2dde9ccb040c 100644 --- a/pyopencl/cache.py +++ b/pyopencl/cache.py @@ -106,6 +106,11 @@ class CacheLockManager(CleanupBase): warn("could not obtain cache lock--delete '%s' if necessary" % self.lock_file) + if attempts > 3 * 60: + raise RuntimeError("waited more than three minutes " + "on the lock file '%s'" + "--something is wrong" % self.lock_file) + cleanup_m.register(self) def clean_up(self):