We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95efdd2 commit ec30518Copy full SHA for ec30518
libsrc/general/ngpython.hpp
@@ -1,5 +1,17 @@
1
#ifdef NG_PYTHON
2
3
+// BEGIN EVIL HACK: Patch PyThread_get_key_value inside pybind11 to avoid deadlocks
4
+// see https://github.com/pybind/pybind11/pull/1211
5
+#include <Python.h>
6
+#include <pythread.h>
7
+namespace pybind11 {
8
+ inline void * PyThread_get_key_value(int state) {
9
+ PyThreadState *tstate = (PyThreadState *) ::PyThread_get_key_value(state);
10
+ if (!tstate) tstate = PyGILState_GetThisThreadState();
11
+ return tstate;
12
+ }
13
+}
14
+// END EVIL HACK
15
#include <pybind11/pybind11.h>
16
#include <pybind11/operators.h>
17
namespace py = pybind11;
0 commit comments