diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-12-01 11:47:39 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-12-01 11:47:47 +0100 |
| commit | c79e52ad304a02cb66c66cfee49c9b82b458e769 (patch) | |
| tree | a663bd9df23c6ca75fc6abe0f12da712929ddc7a /src/utiltime.cpp | |
| parent | Merge #9226: Remove fNetworkNode and pnodeLocalHost. (diff) | |
| parent | Make fStartedNewLine an std::atomic_bool (diff) | |
| download | discoin-c79e52ad304a02cb66c66cfee49c9b82b458e769.tar.xz discoin-c79e52ad304a02cb66c66cfee49c9b82b458e769.zip | |
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)
Diffstat (limited to 'src/utiltime.cpp')
| -rw-r--r-- | src/utiltime.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utiltime.cpp b/src/utiltime.cpp index da590f888..51d545ef8 100644 --- a/src/utiltime.cpp +++ b/src/utiltime.cpp @@ -74,8 +74,9 @@ void MilliSleep(int64_t n) std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) { + static std::locale classic(std::locale::classic()); // std::locale takes ownership of the pointer - std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat)); + std::locale loc(classic, new boost::posix_time::time_facet(pszFormat)); std::stringstream ss; ss.imbue(loc); ss << boost::posix_time::from_time_t(nTime); |