summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2016-08-24 19:56:28 +0200
committerJoel Rosdahl <joel@rosdahl.net>2016-08-27 10:08:14 +0200
commit5aee4b90dc0e5210724bd2bb6d1cabdef6d62393 (patch)
tree6f85651627d5db9a1fa1ff48a4849c8cb1fb97d1
parent87e5aa1257dc572b7154a9f7f642b57b85205f38 (diff)
downloadccache-5aee4b90dc0e5210724bd2bb6d1cabdef6d62393.tar.gz
Improve comments about lock breaking
-rw-r--r--lockfile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lockfile.c b/lockfile.c
index 39e75750..ce3dcf4a 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -149,9 +149,10 @@ lockfile_acquire(const char *path, unsigned staleness_limit)
if (str_eq(content, initial_content)) {
// The lock seems to be stale -- break it.
cc_log("lockfile_acquire: breaking %s", lockfile);
+ // Try to acquire path.lock.lock:
if (lockfile_acquire(lockfile, staleness_limit)) {
- lockfile_release(path);
- lockfile_release(lockfile);
+ lockfile_release(path); // Remove path.lock
+ lockfile_release(lockfile); // Remove path.lock.lock
to_sleep = 1000;
slept = 0;
continue;