Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:58:02

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 #ifndef DD4HEP_MUTEX_H
0015 #define DD4HEP_MUTEX_H
0016 
0017 // C/C++ include files
0018 #if __cplusplus >= 201103L
0019 #include <mutex>
0020 #endif
0021 
0022 /// Namespace for the AIDA detector description toolkit
0023 namespace dd4hep {
0024 #if __cplusplus >= 201103L
0025   typedef std::recursive_mutex            dd4hep_mutex_t;
0026   typedef std::lock_guard<dd4hep_mutex_t> dd4hep_lock_t;
0027 #else
0028 
0029   /// Do-nothing compatibility std::unique_ptr emulation for cxx-98
0030   struct dd4hep_mutex_t {
0031     /// Default constructor
0032     dd4hep_mutex_t() {}
0033     /// Default destructor
0034     ~dd4hep_mutex_t() {}
0035     /// Dummy interface method
0036     int lock()    { return 0;}
0037     /// Dummy interface method
0038     int trylock() { return 0;}
0039     /// Dummy interface method
0040     int unlock()  { return 0;}
0041   };
0042   /// Do-nothing compatibility std::unique_ptr emulation for cxx-98
0043   struct dd4hep_lock_t {
0044     /// Default constructor
0045     dd4hep_lock_t(dd4hep_mutex_t&, bool=true) {}
0046     /// Default destructor
0047     ~dd4hep_lock_t() {}
0048   };
0049 #endif  
0050 }
0051 #endif  // DD4HEP_MUTEX_H