MCPcopy Create free account
hub / github.com/pybind/pybind11 / gil_multi_acquire_release

Function gil_multi_acquire_release

tests/cross_module_gil_utils.cpp:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31void gil_acquire() { py::gil_scoped_acquire gil; }
32
33std::string gil_multi_acquire_release(unsigned bits) {
34 if ((bits & 0x1u) != 0u) {
35 py::gil_scoped_acquire gil;
36 }
37 if ((bits & 0x2u) != 0u) {
38 py::gil_scoped_release gil;
39 }
40 if ((bits & 0x4u) != 0u) {
41 py::gil_scoped_acquire gil;
42 }
43 if ((bits & 0x8u) != 0u) {
44 py::gil_scoped_release gil;
45 }
46 return PYBIND11_INTERNALS_ID;
47}
48
49struct CustomAutoGIL {
50 CustomAutoGIL() : gstate(PyGILState_Ensure()) {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected