From: Joel Rosdahl Date: Wed, 24 Aug 2016 17:56:28 +0000 (+0200) Subject: Improve comments about lock breaking X-Git-Tag: v3.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aee4b90dc0e5210724bd2bb6d1cabdef6d62393;p=thirdparty%2Fccache.git Improve comments about lock breaking --- diff --git a/lockfile.c b/lockfile.c index 39e757501..ce3dcf4aa 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;