aboutsummaryrefslogtreecommitdiff
path: root/src/sync.cpp
Commit message (Collapse)AuthorAgeFilesLines
* sync.h: Make runtime lock checks require compile-time lock checksAnthony Towns2020-08-291-1/+4
|
* test: Add LockStackEmpty()Hennadii Stepanov2020-08-021-0/+11
|
* Preserve initial state if push_lock() throws exceptionHennadii Stepanov2020-08-021-3/+8
|
* Improve "detected inconsistent lock order" error messageHennadii Stepanov2020-06-251-2/+2
|
* test: Improve "potential deadlock detected" exception messageHennadii Stepanov2020-06-221-1/+5
|
* Fix mistakenly swapped "previous" and "current" lock ordersHennadii Stepanov2020-06-221-2/+2
|
* Use template function instead of void* parameterHennadii Stepanov2020-05-281-1/+4
| | | | This change gets rid of -Wthread-safety-attributes warning spam.
* doc: Add and fix comments about never destroyed objectsHennadii Stepanov2020-05-221-0/+2
|
* Replace thread_local g_lockstack with a mutex-protected mapHennadii Stepanov2020-05-191-14/+37
| | | | | | This change prevents UB in case of early g_lockstack destroying. Co-authored-by: Wladimir J. van der Laan <[email protected]>
* refactor: Refactor duplicated code into LockHeld()Hennadii Stepanov2020-05-191-9/+13
|
* refactor: Add LockPair type aliasHennadii Stepanov2020-05-191-8/+10
|
* refactor: Add LockStackItem type aliasHennadii Stepanov2020-05-191-8/+11
|
* Prevent UB in DeleteLock() functionHennadii Stepanov2020-05-191-14/+5
|
* util: Remove unused itostrMarcoFalke2020-03-271-2/+2
|
* sync.h: add REVERSE_LOCKAnthony Towns2020-03-061-1/+18
|
* scripted-diff: Bump copyright of files changed in 2020MarcoFalke2020-01-151-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* scripted-diff: Replace CCriticalSection with RecursiveMutexMarcoFalke2020-01-151-1/+1
| | | | | | | | | -BEGIN VERIFY SCRIPT- # Delete outdated alias for RecursiveMutex sed -i -e '/CCriticalSection/d' ./src/sync.h # Replace use of outdated alias with RecursiveMutex sed -i -e 's/CCriticalSection/RecursiveMutex/g' $(git grep -l CCriticalSection) -END VERIFY SCRIPT-
* scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-301-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* refactor: Remove redundant c_str() calls in formattingWladimir J. van der Laan2019-10-281-2/+2
| | | | | | | | | Our formatter, tinyformat, *never* needs `c_str()` for strings. Remove redundant `c_str()` calls for: - `strprintf` - `LogPrintf` - `tfm::format`
* Remove unused includespracticalswift2019-10-151-2/+0
|
* Replace remaining fprintf with tfm::format manuallyMarcoFalke2019-06-131-1/+1
|
* scripted-diff: Replace fprintf with tfm::formatMarcoFalke2019-06-131-3/+3
| | | | | | | | -BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/fprintf\(std(err|out), /tfm::format(std::c\1, /g' $(git grep -l 'fprintf(' -- ':(exclude)src/crypto' ':(exclude)src/leveldb' ':(exclude)src/univalue' ':(exclude)src/secp256k1') -END VERIFY SCRIPT- fixup! scripted-diff: Replace fprintf with tfm::format
* fix static_assert for macro HAVE_THREAD_LOCALorient2019-05-071-0/+4
| | | fix static_assert for macro HAVE_THREAD_LOCAL while define DEBUG_LOCKCONTENTION
* threads: add thread names to deadlock debugging messageJames O'Beirne2019-04-291-10/+19
| | | | Also refactor CLockLocation to use an initialization list.
* Prevent mutex lock fail even if --enable-debugAkio Nakamura2019-01-251-1/+7
| | | | | | | | | | | | | | | This PR intends to resolve #15227. "configure --debug-enabled" enables "#ifdef DEBUG_LOCKORDER". Then "lockdata" (in sync.cpp) will be initialized same as other static objects. But unfortunately, lockdata.push_lock() was called before its initialization (via initializing signatureCache which is declared in script/sigcache.cpp) on macOS. This PR apply the "Construct On First Use Idiom" to "lockdata" to prevent it.
* scripted-diff: Move util files to separate directory.Jim Posen2018-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
* Merge #11640: Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSectionWladimir J. van der Laan2018-08-311-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9c4dc597ddc66acfd58a945a5ab11f833731abba Use LOCK macros for non-recursive locks (Russell Yanofsky) 1382913e61f5db6ba849b1e261e8aefcd5a1ae68 Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection (Russell Yanofsky) ba1f095aadf29bddb0bd8176d2e0b908f92a5623 MOVEONLY Move AnnotatedMixin declaration (Russell Yanofsky) 41b88e93375d57db12da923f45f87b9a2db8e730 Add unit test for DEBUG_LOCKORDER code (Russell Yanofsky) Pull request description: Make LOCK macros work with non-recursive mutexes, and use wherever possible for better deadlock detection. Also add unit test for DEBUG_LOCKORDER code. Tree-SHA512: 64ef209307f28ecd0813a283f15c6406138c6ffe7f6cbbd084161044db60e2c099a7d0d2edcd1c5e7770a115e9b931b486e86c9a777bdc96d2e8a9f4dc192942
| * Add unit test for DEBUG_LOCKORDER codeRussell Yanofsky2018-08-031-1/+7
| |
* | Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|/
* qa: Initialize lockstack to prevent null pointer derefMarcoFalke2018-05-221-11/+8
|
* break circular dependency: random/sync -> util -> random/syncChun Kuan Lee2018-05-171-3/+5
|
* [logging] Comment all continuing logs.John Newbery2018-04-071-4/+4
| | | | | | | Most logs should terminated with a '\n'. Some logs are built up over multiple calls to logPrintf(), so do not need a newline terminater. Comment all of these 'continued' logs as a linter hing.
* Merge #12859: Bugfix: Include <memory> for std::unique_ptrWladimir J. van der Laan2018-04-051-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr) Pull request description: Not sure why all these includes were missing, but it's breaking builds for some users: https://bugs.gentoo.org/show_bug.cgi?id=652142 (Added to all files with a reference to `std::unique_ptr`) Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
| * Bugfix: Include <memory> for std::unique_ptrLuke Dashjr2018-04-021-0/+1
| |
* | Fix typospracticalswift2018-01-281-2/+2
|/
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* threads: add a thread_local autoconf checkCory Fields2017-11-271-0/+3
|
* Switched sync.{cpp,h} to std threading primitives.Thomas Snider2017-11-181-9/+8
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Add ability to assert a lock is not held in DEBUG_LOCKORDERMatt Corallo2017-10-131-0/+10
|
* Remove unused fTry from push_lockJoão Barbosa2017-09-301-2/+2
|
* Use nullptr instead of zero (0) as the null pointer constantpracticalswift2017-08-161-1/+1
|
* scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-1/+1
| | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* scripted-diff: Remove #include <boost/foreach.hpp>Jorge Timón2017-06-221-1/+0
| | | | | | -BEGIN VERIFY SCRIPT- sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp -END VERIFY SCRIPT-
* scripted-diff: Remove PAIRTYPEJorge Timón2017-06-051-5/+5
| | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/PAIRTYPE(\([^,]*\), \([^\)]*\))/std::pair<\1, \2>/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; sed -i ':a;N;$!ba;s/#define std::pair<t1, t2> std::pair<t1, t2>\n//' ./src/utilstrencodings.h ; -END VERIFY SCRIPT-
* scripted-diff: Fully remove BOOST_FOREACHJorge Timón2017-06-051-5/+5
| | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
* Remove unused codepracticalswift2017-03-171-2/+0
|
* Further-enforce lockordering by enforcing directly after TRY_LOCKsMatt Corallo2017-02-071-15/+13
|
* Always enforce lock strict lock ordering (try or not)Matt Corallo2017-02-021-25/+1
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .