diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 00:49:44 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 00:49:44 +0200 |
commit | ccf9c9a64e4905be91c6a8ef2c7d5d29c58b06fb (patch) | |
tree | c53aca78b25ff10555c4f2d7fabd9c932bb47a6a | |
parent | e2b2fc762f02214dbfbc63d6f04546cd3a0a31cb (diff) | |
download | sink-ccf9c9a64e4905be91c6a8ef2c7d5d29c58b06fb.tar.gz sink-ccf9c9a64e4905be91c6a8ef2c7d5d29c58b06fb.zip |
Set stale lock time.
We're trying to protect against race conditions, a lock time off
500ms should suffice and means we can recover automatically after a
crash.
-rw-r--r-- | synchronizer/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index 2b0cfe3..db74960 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp | |||
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) | |||
45 | const QByteArray instanceIdentifier = argv[1]; | 45 | const QByteArray instanceIdentifier = argv[1]; |
46 | 46 | ||
47 | QLockFile lockfile(instanceIdentifier + ".lock"); | 47 | QLockFile lockfile(instanceIdentifier + ".lock"); |
48 | lockfile.setStaleLockTime(0); | 48 | lockfile.setStaleLockTime(500); |
49 | if (!lockfile.tryLock(0)) { | 49 | if (!lockfile.tryLock(0)) { |
50 | Warning() << "Failed to acquire exclusive lock on socket."; | 50 | Warning() << "Failed to acquire exclusive lock on socket."; |
51 | return -1; | 51 | return -1; |