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 @@ -548,8 +548,8 @@ TEST_CASE("Per-Subinterpreter GIL") {
548
548
main_tstate); // switch back so the scoped_acquire can release the GIL properly
549
549
};
550
550
551
- std::thread (thread_main, 1 ). detach ( );
552
- std::thread (thread_main, 2 ). detach ( );
551
+ std::thread t1 (thread_main, 1 );
552
+ std::thread t2 (thread_main, 2 );
553
553
554
554
// we spawned two threads, at this point they are both waiting for started to increase
555
555
++started;
@@ -590,6 +590,9 @@ TEST_CASE("Per-Subinterpreter GIL") {
590
590
std::this_thread::sleep_for (std::chrono::microseconds (1 ));
591
591
}
592
592
593
+ t1.join ();
594
+ t2.join ();
595
+
593
596
// now we have the gil again, sanity check
594
597
REQUIRE (py::cast<std::string>(py::module_::import (" external_module" ).attr (" multi_interp" ))
595
598
== " 1" );
You can’t perform that action at this time.
0 commit comments