renamed local gil_scoped_acquire to gil_scoped_acquire_local to avoid ambiguity

This commit is contained in:
Wenzel Jakob 2019-07-15 17:29:13 +02:00
parent b60fd233fa
commit b2c4ff6052

View File

@ -173,9 +173,9 @@ PYBIND11_NOINLINE inline internals &get_internals() {
// Ensure that the GIL is held since we will need to make Python calls. // Ensure that the GIL is held since we will need to make Python calls.
// Cannot use py::gil_scoped_acquire here since that constructor calls get_internals. // Cannot use py::gil_scoped_acquire here since that constructor calls get_internals.
struct gil_scoped_acquire { struct gil_scoped_acquire_local {
gil_scoped_acquire() : state (PyGILState_Ensure()) {} gil_scoped_acquire_local() : state (PyGILState_Ensure()) {}
~gil_scoped_acquire() { PyGILState_Release(state); } ~gil_scoped_acquire_local() { PyGILState_Release(state); }
const PyGILState_STATE state; const PyGILState_STATE state;
} gil; } gil;