diff --git a/pytools/persistent_dict.py b/pytools/persistent_dict.py
index 5ca6b91c5fd74b7360dba0b8f4f8b95e392bee51..c10d4e9f51d035fcaaafb496d128f2db46e2cbc5 100644
--- a/pytools/persistent_dict.py
+++ b/pytools/persistent_dict.py
@@ -108,6 +108,10 @@ class LockManager(CleanupBase):
                     from warnings import warn
                     warn("could not obtain 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)