ATLAS Offline Software
Loading...
Searching...
No Matches
PyAthenaGILStateEnsure.h
Go to the documentation of this file.
1
2
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
17namespace RootUtils {
18
20{
21 public:
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
PyGILStateEnsure(const PyGILStateEnsure &)=delete
PyGILStateEnsure & operator=(const PyGILStateEnsure &)=delete