mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Update pybind11, remove evil hack
This commit is contained in:
parent
7934a34872
commit
63b7719c22
@ -1 +1 @@
|
||||
Subproject commit 2a150736601bb3113877bb673fb934bb60d46ec5
|
||||
Subproject commit e2b884c33bcde70b2ea562ffa52dd7ebee276d50
|
@ -1,28 +1,5 @@
|
||||
#ifdef NG_PYTHON
|
||||
|
||||
// BEGIN EVIL HACK: Patch PyThread_get_key_value/PyThread_tss_get inside pybind11 to avoid deadlocks
|
||||
// see https://github.com/pybind/pybind11/pull/1211 (please merge!)
|
||||
#if defined(__GNUG__) && !defined(__clang__)
|
||||
# pragma GCC diagnostic ignored "-Wattributes"
|
||||
#endif
|
||||
#include <Python.h>
|
||||
#include <pythread.h>
|
||||
#include <pybind11/cast.h>
|
||||
#undef PYBIND11_TLS_GET_VALUE
|
||||
#if PY_VERSION_HEX >= 0x03070000
|
||||
inline void * PYBIND11_TLS_GET_VALUE(Py_tss_t *state) {
|
||||
PyThreadState *tstate = (PyThreadState *) PyThread_tss_get(state);
|
||||
if (!tstate) tstate = PyGILState_GetThisThreadState();
|
||||
return tstate;
|
||||
}
|
||||
#else
|
||||
inline void * PYBIND11_TLS_GET_VALUE(int state) {
|
||||
PyThreadState *tstate = (PyThreadState *) PyThread_get_key_value(state);
|
||||
if (!tstate) tstate = PyGILState_GetThisThreadState();
|
||||
return tstate;
|
||||
}
|
||||
#endif
|
||||
// END EVIL HACK
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/numpy.h>
|
||||
|
Loading…
Reference in New Issue
Block a user