aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
AgeCommit message (Collapse)Author
2017-04-03Replace includes of boost/filesystem.h with fs.hWladimir J. van der Laan
This is step one in abstracting the use of boost::filesystem.
2017-04-03Merge #10058: No need to use OpenSSL malloc/freeWladimir J. van der Laan
6d5dd60 No need to use OpenSSL malloc/free (Thomas Snider) Tree-SHA512: 29f790067ffd5a10a8e1a621318a0ba445691f57c804aa3b7c8ca372c8408d8c7fe703c42b48018e400fc32e3feff5ab401d97433910ce2c50e69da0b8a6662e
2017-04-01Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell
This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
2017-03-30util: Work around (virtual) memory exhaustion on 32-bit w/ glibcWladimir J. van der Laan
glibc-specific: On 32-bit systems set the number of arenas to 1. By default, since glibc 2.10, the C library will create up to two heap arenas per core. This is known to cause excessive virtual address space usage in our usage. Work around it by setting the maximum number of arenas to 1.
2017-03-28No need to use OpenSSL malloc/freeThomas Snider
2017-03-09[util] Remove redundant call to get() on smart pointer (thread_specific_ptr)practicalswift
2017-03-08Refactor: Remove using namespace <xxx> from util*Karl-Johan Alm
2017-02-20Fix for issue #9775. Added check for open() returning a NULL pointer.kirit93
2017-01-24Increase minimum debug.log size to 10MB after shrink.Alex Morcos
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-27Add a ForceSetArg method for testingMatt Corallo
2016-12-24Lock mapArgs/mapMultiArgs access in utilMatt Corallo
2016-12-24Un-expose mapArgs from utils.hMatt Corallo
2016-12-23Introduce (and use) an IsArgSet accessor methodMatt Corallo
2016-12-23Fix non-const mapMultiArgs[] access after init.Matt Corallo
Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is only accessed in util.cpp
2016-12-23Remove arguments to ParseConfigFileMatt Corallo
2016-12-19Merge #9236: Fix races for strMiscWarning and fLargeWork*Found, make QT ↵Wladimir J. van der Laan
runawayException use GetWarnings 749be01 Move GetWarnings() into its own file. (Gregory Maxwell) e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell) c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
2016-12-09Refactor: Removed begin/end_ptr functions.Karl-Johan Alm
2016-12-03Move GetWarnings() into its own file.Gregory Maxwell
2016-12-03Eliminate data races for strMiscWarning and fLargeWork*Found.Gregory Maxwell
This moves all access to these datastructures through accessor functions and protects them with a lock.
2016-12-03Make QT runawayException call GetWarnings instead of directly access ↵Gregory Maxwell
strMiscWarning. This is a first step in avoiding racy accesses to strMiscWarning. The change required moving GetWarnings and related globals to util.
2016-12-01Merge #9230: Fix some benign races in timestamp loggingWladimir J. van der Laan
8b22efb Make fStartedNewLine an std::atomic_bool (Matt Corallo) 507145d Fix race when accessing std::locale::classic() (Matt Corallo)
2016-11-29init: Get rid of fServer flagWladimir J. van der Laan
There is no need to store this flag globally, the variable is only used inside the initialization process. Thanks to Alex Morcos for the idea.
2016-11-27Make fStartedNewLine an std::atomic_boolMatt Corallo
While this doesnt really fix the race of adding timestamps mid-logical-line, it avoids the undefined behavior of using a bool in multiple threads.
2016-10-01Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgsJorge Timón
2016-09-21Merge #8656: Trivial: Do not shadow global variable fileoutWladimir J. van der Laan
7c069a7 Do not shadow global variable (Pavel Janík)
2016-09-04trivial: remove unnecessary variable fDaemonmruddy
2016-09-02Do not shadow global variablePavel Janík
2016-07-02[util] CopyrightHolders: Check for untranslated substitutionMarcoFalke
Also, remove check which is always true
2016-06-01Use std::atomic for fRequestShutdown and fReopenDebugLogPieter Wuille
2016-05-12Merge #8004: signal handling: fReopenDebugLog and fRequestShutdown should be ↵Wladimir J. van der Laan
type sig_atomic_t 3262316 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t (Chirag Davé)
2016-05-09fReopenDebugLog and fRequestShutdown should be type sig_atomic_tChirag Davé
This allows access as an atomic variable in the presence of async interrupts. See issue #7433 for more details fixes: #7433
2016-05-05don't run ThreadMessageHandler at lowered priorityKaz Wesley
There's no clear reason ThreadMessageHandler should be low priority. Fixes #8010 (priority inversion).
2016-04-13Removed call to `TryCreateDirectory` from `GetDefaultDataDir` in `src/util.cpp`.Alexander Regueiro
See https://github.com/bitcoin/bitcoin/issues/7845#issuecomment-207684728. Also refactored `GetDefaultDataDir` function to return path for Mac in one expression.
2016-03-11Move GetTempPath() to testutil.Mustafa
2016-02-03Merge branch 'master' into single_prodnameLuke Dashjr
2016-02-03When/if the copyright line does not mention Bitcoin Core developers, add a ↵Luke Dashjr
second line to copyrights in -version, About dialog, and splash screen
2016-01-19Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhereLuke Dashjr
2015-12-22Set copyright holders displayed in notices separately from the package nameLuke Dashjr
This helps avoid accidental removal of upstream copyright names
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-28[trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke
* DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-11-27util: Don't set strMiscWarning on every exceptionWladimir J. van der Laan
Fixes #6809 - run-of-the-mill exceptions should not get into strMiscWarning (which is reported by `getinfo`).
2015-10-26Add option for microsecond precision in debug.logSuhas Daftuar
2015-09-30Changed logging to make -logtimestamps to work also for -printtoconsoleArne Brutschy
2015-09-03Move windows socket init to utility functionWladimir J. van der Laan
2015-07-27Fix argument parsing oddity with -noXWladimir J. van der Laan
`bitcoind -X -noX` ends up, unintuitively, with `X` set. (for all boolean options X) This result is due to the odd two-pass processing of arguments. This patch fixes this oddity and simplifies the code at the same time.
2015-07-23Merge pull request #6287Wladimir J. van der Laan
a794284 locking: add a quick example of GUARDED_BY (Cory Fields) 2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields) cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
2015-07-22Merge pull request #6149Wladimir J. van der Laan
27d7605 Buffer log messages and explicitly open logs (Adam Weiss)
2015-07-14openssl: avoid config file load/raceCory Fields