File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1263,11 +1263,14 @@ PYBIND11_NAMESPACE_END(detail)
12631263// Use to activate Py_MOD_GIL_NOT_USED.
12641264class mod_gil_not_used {
12651265public:
1266- explicit mod_gil_not_used (bool flag = true ) : flag_(flag ) {}
1266+ mod_gil_not_used () : flag_(true ) {}
12671267 bool flag () const { return flag_; }
12681268
1269+ friend mod_gil_not_used mod_gil_used ();
1270+
12691271private:
12701272 bool flag_;
1273+ explicit mod_gil_not_used (bool flag) : flag_(flag) {}
12711274};
12721275
12731276inline mod_gil_not_used mod_gil_used () { return mod_gil_not_used (false ); }
@@ -1540,7 +1543,7 @@ class module_ : public object {
15401543 const char *doc,
15411544 PyModuleDef *def,
15421545 mod_gil_not_used gil_not_used
1543- = mod_gil_not_used( false )) {
1546+ = mod_gil_used( )) {
15441547 // Placement new (not an allocation).
15451548 new (def) PyModuleDef{/* m_base */ PyModuleDef_HEAD_INIT,
15461549 /* m_name */ name,
You can’t perform that action at this time.
0 commit comments