bitcoin/src
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
..
bench Log debug build status and warn when running benchmarks 2018-01-16 11:48:33 +01:00
compat Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
config
consensus Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
crypto Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
leveldb Update LevelDB with latest Bitcoin-specific patches 2017-08-01 12:40:42 -07:00
obj
obj-test
policy fee estimator: avoid sorting mempool on shutdown 2018-01-25 18:02:24 -05:00
primitives Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
qt Fix Windows build errors introduced in #10498 2018-02-12 15:48:37 +01:00
rpc Merge #12193: RPC: Consistently use UniValue.pushKV instead of push_back(Pair()) (karel-3d) 2018-02-12 09:13:38 -05:00
script Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
secp256k1 Bump secp256k1 subtree 2017-09-29 16:02:39 +02:00
support Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
test Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
univalue univalue: Bump subtree 2018-02-10 09:55:54 -05:00
wallet Merge #12193: RPC: Consistently use UniValue.pushKV instead of push_back(Pair()) (karel-3d) 2018-02-12 09:13:38 -05:00
zmq Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
.clang-format
addrdb.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addrdb.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addrman.cpp Merge #11577: Fix warnings (-Wsign-compare) when building with DEBUG_ADDRMAN 2018-01-29 14:26:26 +01:00
addrman.h Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
amount.h
arith_uint256.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
arith_uint256.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
base58.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
base58.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bech32.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bech32.h Import Bech32 C++ reference code & tests 2017-09-28 16:02:16 -07:00
bitcoin-cli-res.rc
bitcoin-cli.cpp Merge #12050: [trivial] Implements a virtual destructor on the BaseRequestHandler class. 2018-02-06 18:05:34 +01:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Properly alphabetize output of CLI --help option. 2018-02-01 23:19:41 -08:00
bitcoind-res.rc
bitcoind.cpp Move scheduler/threadGroup into common-init instead of per-app 2018-01-25 11:35:34 -05:00
blockencodings.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
blockencodings.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bloom.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bloom.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chain.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chain.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chainparams.cpp Fix typos 2018-01-28 13:21:25 +01:00
chainparams.h Merge #11512: Use GetDesireableServiceFlags in seeds, dnsseeds, fixing static seed adding 2018-01-24 13:07:05 +01:00
chainparamsbase.cpp Refactor: One CBaseChainParams should be enough 2018-02-08 22:06:43 +01:00
chainparamsbase.h Refactor: One CBaseChainParams should be enough 2018-02-08 22:06:43 +01:00
chainparamsseeds.h Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
checkpoints.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
checkpoints.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
checkqueue.h [Refactor] Remove unused fQuit var from checkqueue.h 2018-01-07 20:44:21 +00:00
clientversion.cpp Merge #11966: clientversion: Use full commit hash for commit-based version descriptions 2018-02-13 10:58:41 +01:00
clientversion.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coins.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coins.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
compat.h Trivial: Fix #include sys/fcntl.h to just fcntl.h (without sys/) 2018-01-12 11:22:54 +00:00
compressor.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
compressor.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_io.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_memusage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_read.cpp Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
core_write.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
cuckoocache.h Fix header guards using reserved identifiers 2017-08-26 02:56:53 +03:00
dbwrapper.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
dbwrapper.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
fs.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
fs.h
hash.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
hash.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
httprpc.cpp Use the character based overload for std::string::find. 2018-01-11 21:40:51 +01:00
httprpc.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
httpserver.cpp Merge #12366: http: Join worker threads before deleting work queue 2018-02-08 09:21:49 +01:00
httpserver.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
indirectmap.h
init.cpp Merge #12381: Remove more boost threads 2018-02-12 10:34:49 +01:00
init.h Move scheduler/threadGroup into common-init instead of per-app 2018-01-25 11:35:34 -05:00
key.cpp Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings. 2018-02-05 02:25:28 -08:00
key.h Make CKey::Load references const 2018-01-23 13:16:56 -05:00
keystore.cpp Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
keystore.h Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
limitedmap.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
Makefile.am Disallow using addresses in createmultisig 2018-01-11 14:13:24 -05:00
Makefile.bench.include build: Make "make clean" remove all files created when running "make check" 2017-10-04 14:54:41 +02:00
Makefile.leveldb.include
Makefile.qt.include Merge #11621: [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck 2017-11-17 14:04:02 +01:00
Makefile.qttest.include Remove redundant testutil files 2017-09-05 15:02:17 +12:00
Makefile.test.include Merge #11748: [Tests] Adding unit tests for GetDifficulty in blockchain.cpp. 2017-12-23 11:22:18 +01:00
memusage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
merkleblock.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
merkleblock.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
miner.cpp Use mempool's ancestor sort in transaction selection 2018-01-13 15:57:30 -05:00
miner.h Use mempool's ancestor sort in transaction selection 2018-01-13 15:57:30 -05:00
net_processing.cpp Fix ignoring tx data requests when fPauseSend is set on a peer 2018-02-08 18:06:21 -05:00
net_processing.h net: Move misbehaving logging to net logging category 2018-01-24 12:18:29 +01:00
net.cpp boost: remove useless threadGroup parameter from Discover 2018-02-08 14:35:28 -05:00
net.h boost: remove useless threadGroup parameter from Discover 2018-02-08 14:35:28 -05:00
netaddress.cpp Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
netaddress.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
netbase.cpp Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
netbase.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
netmessagemaker.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
noui.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
noui.h
pow.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
pow.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
prevector.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
protocol.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
protocol.h Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
pubkey.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
pubkey.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
random.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
random.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
rest.cpp scripted-diff: Use UniValue.pushKV instead of push_back(Pair()) 2018-02-10 10:05:07 -05:00
reverse_iterator.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
reverselock.h
scheduler.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
scheduler.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
serialize.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
streams.h Fix typos 2018-01-28 13:21:25 +01:00
sync.cpp Fix typos 2018-01-28 13:21:25 +01:00
sync.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
threadinterrupt.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
threadinterrupt.h
threadsafety.h
timedata.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
timedata.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
tinyformat.h [Util] Update tinyformat.h 2017-10-29 21:12:12 +08:00
torcontrol.cpp boost: drop boost threads from torcontrol 2018-02-08 14:35:29 -05:00
torcontrol.h boost: drop boost threads from torcontrol 2018-02-08 14:35:29 -05:00
txdb.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
txdb.h Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
txmempool.cpp Remove unused mempool index 2018-01-09 08:59:21 -05:00
txmempool.h Avoid leaking prioritization information when relaying transactions 2018-01-25 18:02:24 -05:00
ui_interface.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
ui_interface.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
uint256.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
uint256.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
undo.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
util.cpp util: Fix multiple use of LockDirectory 2018-02-15 16:24:45 +01:00
util.h Add AbsPathForConfigVal to consolidate datadir prefixing for path args 2018-02-05 17:48:59 -05:00
utilmoneystr.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilmoneystr.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilstrencodings.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilstrencodings.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utiltime.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utiltime.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
validation.cpp Merge #12381: Remove more boost threads 2018-02-12 10:34:49 +01:00
validation.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
validationinterface.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
validationinterface.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
version.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
versionbits.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
versionbits.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
warnings.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
warnings.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00