Commit graph

285 commits

Author SHA1 Message Date
Wladimir J. van der Laan
c79e52ad30
Merge #9230: Fix some benign races in timestamp logging
8b22efb Make fStartedNewLine an std::atomic_bool (Matt Corallo)
507145d Fix race when accessing std::locale::classic() (Matt Corallo)
2016-12-01 11:47:47 +01:00
Wladimir J. van der Laan
deec83fd2c init: Get rid of fServer flag
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-29 12:47:13 +01:00
Matt Corallo
8b22efb6f7 Make fStartedNewLine an std::atomic_bool
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-11-27 15:36:44 -08:00
Jorge Timón
3450c18a12
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs 2016-10-01 08:12:19 +02:00
Wladimir J. van der Laan
cf5ebaa921
Merge #8656: Trivial: Do not shadow global variable fileout
7c069a7 Do not shadow global variable (Pavel Janík)
2016-09-21 14:13:44 +02:00
mruddy
ff2ed7a5bc trivial: remove unnecessary variable fDaemon 2016-09-04 11:42:07 -04:00
Pavel Janík
7c069a7093 Do not shadow global variable 2016-09-02 20:50:59 +02:00
MarcoFalke
33336e1aac [util] CopyrightHolders: Check for untranslated substitution
Also, remove check which is always true
2016-07-02 10:46:26 +02:00
Pieter Wuille
a886dbf8e7 Use std::atomic for fRequestShutdown and fReopenDebugLog 2016-06-01 19:18:25 +02:00
Wladimir J. van der Laan
2efe38b832
Merge #8004: signal handling: fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
3262316 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t (Chirag Davé)
2016-05-12 11:46:10 +02:00
Chirag Davé
326231611b fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
This allows access as an atomic variable in the presence
of async interrupts.

See issue #7433 for more details
fixes: #7433
2016-05-09 08:20:58 -07:00
Kaz Wesley
e53e7c5473 don't run ThreadMessageHandler at lowered priority
There's no clear reason ThreadMessageHandler should be low priority.
Fixes #8010 (priority inversion).
2016-05-05 13:25:35 -07:00
Alexander Regueiro
41dbc4849e Removed call to TryCreateDirectory from GetDefaultDataDir in src/util.cpp.
See https://github.com/bitcoin/bitcoin/issues/7845#issuecomment-207684728.
Also refactored `GetDefaultDataDir` function to return path for Mac in one expression.
2016-04-13 00:11:47 +01:00
Mustafa
2fdaa25529 Move GetTempPath() to testutil. 2016-03-11 15:04:05 +00:00
Luke Dashjr
a68bb9f5e7 Merge branch 'master' into single_prodname 2016-02-03 05:41:13 +00:00
Luke Dashjr
027fdb83b4 When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen 2016-02-03 05:38:51 +00:00
Luke Dashjr
3cae14056a Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhere 2016-01-19 08:42:05 +00:00
Luke Dashjr
917b1d03cf Set copyright holders displayed in notices separately from the package name
This helps avoid accidental removal of upstream copyright names
2015-12-22 12:29:18 +00:00
MarcoFalke
fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
MarcoFalke
faf93f37fe [trivial] Reuse translation and cleanup DEFAULT_* values
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
2015-11-28 19:01:11 +01:00
Luke Dashjr
b966aa836a Constrain constant values to a single location in code 2015-11-28 18:47:29 +01:00
Wladimir J. van der Laan
9b63758974 util: Don't set strMiscWarning on every exception
Fixes #6809 - run-of-the-mill exceptions should not get into
strMiscWarning (which is reported by `getinfo`).
2015-11-27 13:36:11 +01:00
Suhas Daftuar
7bbc7c314f Add option for microsecond precision in debug.log 2015-10-26 15:05:37 -04:00
Arne Brutschy
58981d4f7d Changed logging to make -logtimestamps to work also for -printtoconsole 2015-09-30 17:57:28 +02:00
Wladimir J. van der Laan
26c9b83677 Move windows socket init to utility function 2015-09-03 10:59:19 +02:00
Wladimir J. van der Laan
c38c49d0b7 Fix argument parsing oddity with -noX
`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-27 14:47:54 +02:00
Wladimir J. van der Laan
d2464dfee9
Merge pull request #6287
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-23 18:45:26 +02:00
Wladimir J. van der Laan
633fe10869
Merge pull request #6149
27d7605 Buffer log messages and explicitly open logs (Adam Weiss)
2015-07-22 18:24:20 +02:00
Cory Fields
d4b1d5a8ba openssl: avoid config file load/race 2015-07-14 17:54:04 -04:00
Adam Weiss
27d7605804 Buffer log messages and explicitly open logs
Prevents stomping on debug logs in datadirs that are locked by other
instances and lost parameter interaction messages that can get wiped by
ShrinkDebugFile().

The log is now opened explicitly and all emitted messages are buffered
until this open occurs.  The version message and log cut have also been
moved to the earliest possible sensible location.
2015-07-06 21:54:31 -04:00
Wladimir J. van der Laan
47162673c7 Use real number of cores for default -par, ignore virtual cores
To determine the default for `-par`, the number of script verification
threads, use [boost:🧵:physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.
2015-07-01 18:01:16 +02:00
Cory Fields
2b890dd424 locking: fix a few small issues uncovered by -Wthread-safety
- rpcwallet: No need to lock twice here
- openssl: Clang doesn't understand selective lock/unlock here. Ignore it.
- CNode: Fix a legitimate (though very unlikely) locking bug.
2015-06-16 04:04:02 -04:00
Philip Kaufmann
a9ac95c1bc use const references where appropriate 2015-06-04 19:34:18 +02:00
lpescher
cb87386241 Make command line option to show all debugging consistent with similar options
Most people expect a value of 1 to enable all for command line arguments.
However to do this for the -debug option you must type "-debug=".
This has been changed to allow "-debug=1" as well as "-debug=" to
enable all debug logging
2015-05-19 22:14:35 -06:00
Philip Kaufmann
5207f33f45 fix header include groups 2015-05-14 01:02:01 -04:00
Jonas Schnelli
3da7849007 [squashme] simplify SetupEnvironment() (by dexX7) 2015-05-10 10:06:41 +02:00
Jonas Schnelli
b3ffcdf916 don't imbue boost::filesystem::path with locale "C" on windows
fixes https://github.com/bitcoin/bitcoin/issues/6078
2015-05-01 13:32:25 +02:00
Wladimir J. van der Laan
8a10000222
Merge pull request #6022
b74dcb3 Separate CTranslationInterface from CClientUIInterface (Jorge Timón)
2015-04-30 16:37:18 +02:00
sinetek
7f386d2ff2 DragonFlyBSD thread renaming. 2015-04-29 20:04:34 +07:00
sinetek
cd558b421c FreeBSD, OpenBSD thread renaming. 2015-04-21 03:13:07 +07:00
Jorge Timón
b74dcb3b4a Separate CTranslationInterface from CClientUIInterface 2015-04-16 19:58:48 +02:00
dexX7
ba0fa0d9bc
Initialization: set fallback locale as environment variable
The scope of `std::locale::global` appears to be smaller than `setenv("LC_ALL", ...)` and insufficient to fix messed up locale settings for the whole application.
2015-03-27 01:57:00 +01:00
dexX7
317e66c741
Initialization: set Boost path locale in main thread
The path locale is lazy initialized and to avoid deinitialization errors
in multithreading environments, it is set explicitly by the main thread.
2015-03-11 14:33:29 +01:00
Luca Venturini
1fdb9fa3f9 Help messages correctly formatted (79 chars)
Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format works even if the translation of the strings
modifies the lenght of the message.

Sqashed 6 commits in a single one.
Help messages correctly formatted for SVGA text mode (132 chars)

Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format should work even if the translation of the strings
modifies the lenght of the message.

Fix - syntax error

Correct formatting for 79 chars

Correctly based on C++ functions

Removed spare spaces from option strings

Fix - syntax error
2015-03-10 22:07:17 -07:00
Wladimir J. van der Laan
47a79bb880
Merge #5366: No longer check osx compatibility in RenameThread
850c570 No longer check osx compatibility in RenameThread (Michael Ford)
2015-02-18 17:36:39 +01:00
sandakersmann
f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Philip Kaufmann
27df4123c4 make all catch() arguments const
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and
  thought it would be a good idea
- also unify used format to better be able to search for exception
  uses in our codebase
2014-12-17 09:39:24 +01:00
Michael Ford
850c570d68 No longer check osx compatibility in RenameThread
10.5 support has been dropped for some time now.
2014-11-25 16:12:55 +08:00
Michael Ford
c63a73d18a Update comments in util to be doxygen compatible 2014-11-17 11:04:01 +08:00
21E14
a2cfae8e18 util.cpp comment correction 2014-11-01 09:41:48 -04:00