summaryrefslogtreecommitdiff
path: root/lib/dir_lock.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /lib/dir_lock.h
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'lib/dir_lock.h')
-rw-r--r--lib/dir_lock.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/dir_lock.h b/lib/dir_lock.h
index 3e9f2a79..925d99d6 100644
--- a/lib/dir_lock.h
+++ b/lib/dir_lock.h
@@ -9,6 +9,9 @@
#include <memory>
#include <zen/file_error.h>
+namespace zen
+{
+const size_t GUI_CALLBACK_INTERVAL = 100;
struct DirLockCallback //while waiting for the lock
{
@@ -20,12 +23,12 @@ struct DirLockCallback //while waiting for the lock
/*
RAII structure to place a directory lock against other FFS processes:
- recursive locking supported, even with alternate lockfile names, e.g. via symlinks, network mounts etc.
- - ownership shared between all object instances refering to a specific lock location(= UUID)
+ - ownership shared between all object instances refering to a specific lock location(= GUID)
- can be copied safely and efficiently! (ref-counting)
- detects and resolves abandoned locks (instantly if lock is associated with local pc, else after 30 seconds)
- temporary locks created during abandoned lock resolution keep "lockfilename"'s extension
- race-free (Windows, almost on Linux(NFS))
- - currently NOT thread-safe! (static LockAdmin)
+ - NOT thread-safe! (1. static LockAdmin 2. directory name aliases must be resolved sequentially!)
*/
class DirLock
{
@@ -37,5 +40,6 @@ private:
class SharedDirLock;
std::shared_ptr<SharedDirLock> sharedLock;
};
+}
#endif // DIR_LOCK_H_INCLUDED
bgstack15