We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c83462 commit 6922d7dCopy full SHA for 6922d7d
include/pybind11/detail/internals.h
@@ -712,6 +712,11 @@ class internals_pp_manager {
712
}
713
714
static void fail_if_internals_recreated(std::unique_ptr<InternalsType> *pp) {
715
+#ifdef PYBIND11_HAS_SUBINTERPRETER_SUPPORT
716
+ static std::mutex mtx;
717
+ std::lock_guard<std::mutex> lock(mtx);
718
+#endif
719
+
720
auto &pps_have_created_content_ = pps_have_created_content();
721
722
// Prevent re-creation of internals after destruction during interpreter shutdown.
0 commit comments