File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,9 @@ inline uint64_t round_up_to_next_pow2(uint64_t x) {
445
445
446
446
template <typename InternalsType>
447
447
inline InternalsType **find_or_create_internals_pp (char const *state_dict_key) {
448
+ #if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
449
+ gil_scoped_acquire gil;
450
+ #else
448
451
// Ensure that the GIL is held since we will need to make Python calls.
449
452
// Cannot use py::gil_scoped_acquire here since that constructor calls get_internals.
450
453
struct gil_scoped_acquire_local {
@@ -454,6 +457,7 @@ inline InternalsType **find_or_create_internals_pp(char const *state_dict_key) {
454
457
~gil_scoped_acquire_local () { PyGILState_Release (state); }
455
458
const PyGILState_STATE state;
456
459
} gil;
460
+ #endif
457
461
458
462
error_scope err_scope;
459
463
You can’t perform that action at this time.
0 commit comments