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 8b3397d commit f8ff4deCopy full SHA for f8ff4de
libsrc/core/python_core.hpp
@@ -10,6 +10,18 @@
10
#pragma clang diagnostic ignored "-Wunused-value"
11
#endif
12
13
+// BEGIN EVIL HACK: Patch PyThread_get_key_value inside pybind11 to avoid deadlocks
14
+// see https://github.com/pybind/pybind11/pull/1211
15
+#include <Python.h>
16
+#include <pythread.h>
17
+namespace pybind11 {
18
+ inline void * PyThread_get_key_value(int state) {
19
+ PyThreadState *tstate = (PyThreadState *) ::PyThread_get_key_value(state);
20
+ if (!tstate) tstate = PyGILState_GetThisThreadState();
21
+ return tstate;
22
+ }
23
+}
24
+// END EVIL HACK
25
#include <pybind11/pybind11.h>
26
#include <pybind11/eval.h>
27
#include <pybind11/operators.h>
0 commit comments