MCPcopy Create free account
hub / github.com/apache/arrow / optional_gil_release

Method optional_gil_release

python/pyarrow/src/arrow/python/common.h:269–274  ·  view source on GitHub ↗

Only release the GIL if we own an object *and* the Python runtime is valid *and* the GIL is held.

Source from the content-addressed store, hash-verified

267 // Only release the GIL if we own an object *and* the Python runtime is
268 // valid *and* the GIL is held.
269 std::optional<PyReleaseGIL> optional_gil_release() const {
270 if (this->get() != nullptr && Py_IsInitialized() && PyGILState_Check()) {
271 return PyReleaseGIL();
272 }
273 return {};
274 }
275};
276
277/// \brief A std::shared_ptr<T, ...> subclass that releases the GIL when destroying T

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected