debug
This commit is contained in:
parent
4d439101ca
commit
0673469b29
|
@ -1,14 +1,18 @@
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <iostream>
|
||||||
struct PyLockGIL
|
struct PyLockGIL
|
||||||
{
|
{
|
||||||
|
|
||||||
PyLockGIL(): gstate(PyGILState_Ensure())
|
PyLockGIL(): gstate(PyGILState_Ensure())
|
||||||
{
|
{
|
||||||
|
std::cout << "construct GIL" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
~PyLockGIL()
|
~PyLockGIL()
|
||||||
{
|
{
|
||||||
PyGILState_Release(gstate);
|
PyGILState_Release(gstate);
|
||||||
|
std::cout << "destruct GIL" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyLockGIL(const PyLockGIL&) = delete;
|
PyLockGIL(const PyLockGIL&) = delete;
|
||||||
|
|
Loading…
Reference in New Issue