DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Mutex.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef DD4HEP_MUTEX_H
15 #define DD4HEP_MUTEX_H
16 
17 // C/C++ include files
18 #if __cplusplus >= 201103L
19 #include <mutex>
20 #endif
21 
23 namespace DD4hep {
24 #if __cplusplus >= 201103L
25  typedef std::recursive_mutex dd4hep_mutex_t;
26  typedef std::lock_guard<dd4hep_mutex_t> dd4hep_lock_t;
27 #else
28  struct dd4hep_mutex_t {
31  int lock() { return 0;}
32  int trylock() { return 0;}
33  int unlock() { return 0;}
34  };
35  struct dd4hep_lock_t {
36  dd4hep_lock_t(dd4hep_mutex_t&, bool=true) {}
38  };
39 #endif
40 }
41 #endif // DD4HEP_MUTEX_H
dd4hep_lock_t(dd4hep_mutex_t &, bool=true)
Definition: Mutex.h:36