diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-03-11 20:15:10 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-03-11 20:15:10 +0200 |
commit | dfd0e9c97d80c5cd7115d6cbb49cce08168071b6 (patch) | |
tree | 7bb5c56c18c83f3180101e310198cb3e3fdf1ab7 /contrib/otshell_utils/utils.cpp | |
parent | Merge pull request #711 (diff) | |
parent | Need to link boost::chrono in more places now (diff) | |
download | monero-dfd0e9c97d80c5cd7115d6cbb49cce08168071b6.tar.xz |
Merge pull request #712
66c2fc7 Need to link boost::chrono in more places now (Howard Chu)
b937a2c Use boost::thread instead of std::thread (Howard Chu)
Diffstat (limited to 'contrib/otshell_utils/utils.cpp')
-rw-r--r-- | contrib/otshell_utils/utils.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/otshell_utils/utils.cpp b/contrib/otshell_utils/utils.cpp index bbae7c654..ef9b37f03 100644 --- a/contrib/otshell_utils/utils.cpp +++ b/contrib/otshell_utils/utils.cpp @@ -12,6 +12,7 @@ #include <fstream> #include <iostream> #include <iomanip> +#include <chrono> #include "utils.hpp" @@ -129,7 +130,7 @@ std::string get_current_time() { cNullstream g_nullstream; // extern a stream that does nothing (eats/discards data) -std::recursive_mutex gLoggerGuard; // extern +boost::recursive_mutex gLoggerGuard; // extern std::atomic<int> gLoggerGuardDepth; // extern std::atomic<int> & gLoggerGuardDepth_Get() { @@ -303,7 +304,7 @@ mPid2Number_Biggest(0) mIsBroken=false; // ok, constr. succeeded, so string is not broken now // this is here, because it could be using logging itself to log creation of first thread/PID etc - Thread2Number( std::this_thread::get_id() ); // convert current id to short number, useful to reserve a number so that main thread is usually called 1 + Thread2Number( boost::this_thread::get_id() ); // convert current id to short number, useful to reserve a number so that main thread is usually called 1 Pid2Number( getpid() ); // add this proces ID as first one } @@ -348,7 +349,7 @@ std::ostream & cLogger::write_stream(int level, const std::string & channel ) { output << windows_stream(level); #endif output << icon(level) << ' '; - std::thread::id this_id = std::this_thread::get_id(); + boost::thread::id this_id = boost::this_thread::get_id(); output << "{" << Thread2Number(this_id) << "}"; auto nicePid = Pid2Number(getpid()); if (nicePid>0) output << " {p" << nicePid << "}"; @@ -517,7 +518,7 @@ std::string cLogger::endline() const { #endif } -int cLogger::Thread2Number(const std::thread::id id) { +int cLogger::Thread2Number(const boost::thread::id id) { auto found = mThread2Number.find( id ); if (found == mThread2Number.end()) { // new one mThread2Number_Biggest++; |