We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3036f9f commit 22968e9Copy full SHA for 22968e9
tests/test_embed/test_interpreter.cpp
@@ -548,8 +548,8 @@ TEST_CASE("Per-Subinterpreter GIL") {
548
main_tstate); // switch back so the scoped_acquire can release the GIL properly
549
};
550
551
- std::thread(thread_main, 1).detach();
552
- std::thread(thread_main, 2).detach();
+ std::thread t1(thread_main, 1);
+ std::thread t2(thread_main, 2);
553
554
// we spawned two threads, at this point they are both waiting for started to increase
555
++started;
@@ -590,6 +590,9 @@ TEST_CASE("Per-Subinterpreter GIL") {
590
std::this_thread::sleep_for(std::chrono::microseconds(1));
591
}
592
593
+ t1.join();
594
+ t2.join();
595
+
596
// now we have the gil again, sanity check
597
REQUIRE(py::cast<std::string>(py::module_::import("external_module").attr("multi_interp"))
598
== "1");
0 commit comments