Changeset 20096 for trunk/Mars/mbase


Ignore:
Timestamp:
05/07/21 12:37:39 (4 years ago)
Author:
tbretz
Message:
root 6.24 requires some more includes, clasng 10 is a bit more picky about overload warinings and casting, gErrorMutex i deprecated -> so we can only lock our error handler again ourselves... well... mess ahead... thank you.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mbase/MLog.cc

    r14079 r20096  
    9999#include <iomanip>
    100100
     101#if ROOT_VERSION_CODE >= ROOT_VERSION(6,24,00)
     102#include <mutex>
     103#endif
     104
     105
    101106#include <TROOT.h>      // gROOT->GetListOfCleanups()
    102107#include <TSystem.h>
     
    150155MLog gLog;
    151156
     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 
    152163// --------------------------------------------------------------------------
    153164//
     
    760771    // if abort is set it aborts the application.
    761772   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
    763778
    764779      gErrorIgnoreLevel = 0;
     
    789804void MLog::ErrorHandlerPrint(Int_t level, const char *location, const char *msg)
    790805{
     806#if ROOT_VERSION_CODE < ROOT_VERSION(6,24,00)
    791807    R__LOCKGUARD2(gErrorMutex);
     808#else
     809    std::lock_guard<std::mutex> guard(*GetErrorMutex());
     810#endif
    792811
    793812    if (level >= kError)
Note: See TracChangeset for help on using the changeset viewer.