Wladimir J. van der Laan fc888bfcac util: Fix multiple use of LockDirectory
This commit fixes problems with calling LockDirectory multiple times on
the same directory, or from multiple threads. It also fixes the build on
OpenBSD.

- Wrap the boost::interprocess::file_lock in a std::unique_ptr inside
  the map that keeps track of per-directory locks. This fixes a build
  issue with the clang 4.0.0+boost-1.58.0p8 version combo on OpenBSD
  6.2, and should have no observable effect otherwise.

- Protect the locks map using a mutex.

- Make sure that only locks that are successfully acquired are inserted
  in the map.

- Open the lock file for appending only if we know we don't have the
  lock yet - The `FILE* file = fsbridge::fopen(pathLockFile, "a");`
  wipes the 'we own this lock' administration, likely because it opens
  a new fd for the locked file then closes it.
2018-02-15 16:24:45 +01:00
..
2018-02-11 10:48:15 +01:00
2017-09-29 16:02:39 +02:00
2018-02-11 10:48:15 +01:00
2018-02-10 09:55:54 -05:00
2018-01-28 13:21:25 +01:00
2018-02-11 10:48:15 +01:00
2018-01-23 13:16:56 -05:00
2018-01-10 20:55:41 -10:00
2018-01-28 13:21:25 +01:00
2018-01-28 13:21:25 +01:00
2017-10-29 21:12:12 +08:00
2018-01-09 08:59:21 -05:00