Changeset 20096 for trunk/Mars/mbase
- Timestamp:
- 05/07/21 12:37:39 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mbase/MLog.cc
r14079 r20096 99 99 #include <iomanip> 100 100 101 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,24,00) 102 #include <mutex> 103 #endif 104 105 101 106 #include <TROOT.h> // gROOT->GetListOfCleanups() 102 107 #include <TSystem.h> … … 150 155 MLog gLog; 151 156 157 /// Serializes error output, destructed by the gROOT destructor via ReleaseDefaultErrorHandler() 158 static std::mutex *GetErrorMutex() { 159 static std::mutex *m = new std::mutex(); 160 return m; 161 } 162 152 163 // -------------------------------------------------------------------------- 153 164 // … … 760 771 // if abort is set it aborts the application. 761 772 if (gErrorIgnoreLevel == kUnset) { 762 R__LOCKGUARD2(gErrorMutex); 773 #if ROOT_VERSION_CODE < ROOT_VERSION(6,24,00) 774 R__LOCKGUARD2(gErrorMutex); 775 #else 776 std::lock_guard<std::mutex> guard(*GetErrorMutex()); 777 #endif 763 778 764 779 gErrorIgnoreLevel = 0; … … 789 804 void MLog::ErrorHandlerPrint(Int_t level, const char *location, const char *msg) 790 805 { 806 #if ROOT_VERSION_CODE < ROOT_VERSION(6,24,00) 791 807 R__LOCKGUARD2(gErrorMutex); 808 #else 809 std::lock_guard<std::mutex> guard(*GetErrorMutex()); 810 #endif 792 811 793 812 if (level >= kError)
Note:
See TracChangeset
for help on using the changeset viewer.