Skip to content

Commit 5f2c7de

Browse files
committed
Try to gracefully finish the timed_join test in case of timeout.
1 parent 5e2f7fa commit 5f2c7de

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/test_thread.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ void do_test_timed_join()
197197
BOOST_CHECK(xt>now);
198198
BOOST_CHECK(joined2);
199199
BOOST_CHECK(!thrd.joinable());
200+
if (thrd.joinable())
201+
{
202+
// Try to finish the failed test gracefully
203+
thrd.interrupt();
204+
thrd.join();
205+
}
200206
}
201207

202208
BOOST_AUTO_TEST_CASE(test_timed_join)

0 commit comments

Comments
 (0)