Skip to content

Commit cef0ea7

Browse files
committed
fix: remove the true/false parameter from mod_gil_not_used
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 7ade984 commit cef0ea7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/pybind11/pybind11.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,11 +1263,14 @@ PYBIND11_NAMESPACE_END(detail)
12631263
// Use to activate Py_MOD_GIL_NOT_USED.
12641264
class mod_gil_not_used {
12651265
public:
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+
12691271
private:
12701272
bool flag_;
1273+
explicit mod_gil_not_used(bool flag) : flag_(flag) {}
12711274
};
12721275

12731276
inline 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,

0 commit comments

Comments
 (0)