rogue
Loading...
Searching...
No Matches
GilRelease.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_GIL_RELEASE_H__
18#define __ROGUE_GIL_RELEASE_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22#ifndef NO_PYTHON
23 #include <boost/python.hpp>
24#endif
25
26namespace rogue {
27
37#ifndef NO_PYTHON
38 PyThreadState* state_;
39#endif
40
41 public:
43 GilRelease();
46
48 void acquire();
49
51 void release();
52};
53} // namespace rogue
54
55#endif
RAII helper that releases the Python GIL for a scope.
Definition GilRelease.h:36
void acquire()
Re-acquires the GIL explicitly.
~GilRelease()
Re-acquires the GIL if currently released.
GilRelease()
Constructs and releases the GIL for this scope.
void release()
Releases the GIL explicitly.