diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:13:13 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:13:13 +0200 |
commit | 7f23ee90fd545995a29e2175f15e8b97e59ca67a (patch) | |
tree | f8d0afac51995032e58b9a475ccbbc73ba207baf /library/dir_lock.cpp | |
parent | 3.19 (diff) | |
download | FreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.tar.gz FreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.tar.bz2 FreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.zip |
3.20
Diffstat (limited to 'library/dir_lock.cpp')
-rw-r--r-- | library/dir_lock.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/library/dir_lock.cpp b/library/dir_lock.cpp index 1775026b..6123449b 100644 --- a/library/dir_lock.cpp +++ b/library/dir_lock.cpp @@ -42,15 +42,13 @@ const size_t DETECT_EXITUS_INTERVAL = 30000; //assume abandoned lock; unit [ms] const char LOCK_FORMAT_DESCR[] = "FreeFileSync"; const int LOCK_FORMAT_VER = 1; //lock file format version - -typedef Zbase<Zchar, StorageDeepCopy> BasicString; //thread safe string class } //worker thread class LifeSigns { public: - LifeSigns(const BasicString& lockfilename) : //throw()!!! siehe SharedDirLock() + LifeSigns(const Zstring& lockfilename) : //throw()!!! siehe SharedDirLock() lockfilename_(lockfilename) {} //thread safety: make deep copy! void operator()() const //thread entry @@ -120,8 +118,7 @@ public: } private: - //make sure this instance is safely copyable! - const BasicString lockfilename_; //thread local! Not ref-counted! + const Zstring lockfilename_; //thread local! atomic ref-count => binary value-type semantics! }; @@ -494,7 +491,7 @@ public: while (!::tryLock(lockfilename)) //throw (FileError) ::waitOnDirLock(lockfilename, callback); // - threadObj = boost::thread(LifeSigns(lockfilename.c_str())); + threadObj = std::move(boost::thread(LifeSigns(lockfilename))); } ~SharedDirLock() |