ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TMCtls.h
Go to the documentation of this file.
1 // @(#)root/vmc:$Id$
2 // Author: Ivana Hrivnacova, 29/04/2014
3 
4 /*************************************************************************
5  * Copyright (C) 2014, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 // ********************************************************************
13 // * License and Disclaimer *
14 // * *
15 // * The Geant4 software is copyright of the Copyright Holders of *
16 // * the Geant4 Collaboration. It is provided under the terms and *
17 // * conditions of the Geant4 Software License, included in the file *
18 // * LICENSE and available at http://cern.ch/geant4/license . These *
19 // * include a list of copyright holders. *
20 // * *
21 // * Neither the authors of this software system, nor their employing *
22 // * institutes,nor the agencies providing financial support for this *
23 // * work make any representation or warranty, express or implied, *
24 // * regarding this software system or assume any liability for its *
25 // * use. Please see the license in the file LICENSE and URL above *
26 // * for the full disclaimer and the limitation of liability. *
27 // * *
28 // * This code implementation is the result of the scientific and *
29 // * technical work of the GEANT4 collaboration. *
30 // * By using, copying, modifying or distributing the software (or *
31 // * any work based on the software) you agree to acknowledge its *
32 // * use in resulting scientific publications, and indicate your *
33 // * acceptance of all terms of the Geant4 Software license. *
34 // ********************************************************************
35 
36 #ifndef ROOT_TMCtls
37 #define ROOT_TMCtls
38 
39 // Thread Local Storage typedefs
40 //
41 // According to Geant4 tls.hh and G4Threading.hh
42 
43 // Always build with thread support but keep a possibility to introduce
44 // a build option
45 #define VMC_MULTITHREADED 1
46 
47 #if ( defined (VMC_MULTITHREADED) )
48 /*
49  #if ( ( defined(__MACH__) && defined(__clang__) && defined(__x86_64__) ) || \
50  ( defined(__MACH__) && defined(__GNUC__) && __GNUC__>=4 && __GNUC_MINOR__>=7 ) || \
51  defined(__linux__) || defined(_AIX) ) && ( !defined(__CINT__) )
52 */
53  #if ( defined(__linux__) ) && ( !defined(__CINT__) )
54  // Multi-threaded build: for POSIX systems
55  #include <pthread.h>
56  #define TMCThreadLocal __thread
57  #else
58  //# error "No Thread Local Storage (TLS) technology supported for this platform. Use sequential build !"
59  #define TMCThreadLocal
60  #endif
61 #else
62  #define TMCThreadLocal
63 #endif
64 
65 #endif //ROOT_TMCtls