Update pybind11, remove evil hack

This commit is contained in:
Matthias Hochsteger 2018-12-03 11:38:11 +01:00
parent 7934a34872
commit 63b7719c22
2 changed files with 1 additions and 24 deletions

@ -1 +1 @@
Subproject commit 2a150736601bb3113877bb673fb934bb60d46ec5
Subproject commit e2b884c33bcde70b2ea562ffa52dd7ebee276d50

View File

@ -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>