ATLAS Offline Software
PyAthenaGILStateEnsure.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PyAthenaGILStateEnsure.h
8 // Header file for convenience class to ensure GIL
9 // Author: Wim Lavrijsen <WLavrijsen@lbl.gov>
11 #ifndef ROOTUTILS_PYGILSTATEENSURE_H
12 #define ROOTUTILS_PYGILSTATEENSURE_H
13 
14 // Python includes
15 #include "Python.h"
16 
17 namespace RootUtils {
18 
20 {
21  public:
23  PyGILStateEnsure( const PyGILStateEnsure& ) = delete;
26 
27  private:
28  PyGILState_STATE m_gstate;
29 };
30 
34 
36  : m_gstate (PyGILState_Ensure())
37 {
38 }
39 
41 {
42  PyGILState_Release( m_gstate );
43 }
44 
45 } //> namespace RootUtils
46 
47 #endif //> ROOTUTILS_PYATHENA_PYGILSTATEENSURE_H
RootUtils::PyGILStateEnsure::operator=
PyGILStateEnsure & operator=(const PyGILStateEnsure &)=delete
RootUtils
Definition: ILogger.h:20
RootUtils::PyGILStateEnsure
Definition: PyAthenaGILStateEnsure.h:20
RootUtils::PyGILStateEnsure::PyGILStateEnsure
PyGILStateEnsure(const PyGILStateEnsure &)=delete
RootUtils::PyGILStateEnsure::PyGILStateEnsure
PyGILStateEnsure()
Inline methods:
Definition: PyAthenaGILStateEnsure.h:35
RootUtils::PyGILStateEnsure::~PyGILStateEnsure
~PyGILStateEnsure()
Definition: PyAthenaGILStateEnsure.h:40
RootUtils::PyGILStateEnsure::m_gstate
PyGILState_STATE m_gstate
Definition: PyAthenaGILStateEnsure.h:28