Skip to content

Commit e70b38b

Browse files
committed
Explicit py::gil_scoped_release() in test_interpreter.cpp TEST_CASE("Threads")
1 parent 7bbc06e commit e70b38b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_embed/test_interpreter.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,13 @@ TEST_CASE("Threads") {
292292
auto locals = py::dict("count"_a = 0);
293293

294294
{
295-
py::gil_scoped_release gil_release{};
295+
// This used to be triggered by py::gil_scoped_release().
296+
// TODO: Explain why/how this is relevant to this unit test.
297+
py::detail::get_internals();
296298
REQUIRE(has_pybind11_internals_static());
297299

300+
py::gil_scoped_release gil_release{};
301+
298302
auto threads = std::vector<std::thread>();
299303
for (auto i = 0; i < num_threads; ++i) {
300304
threads.emplace_back([&]() {

0 commit comments

Comments
 (0)