Skip to content
Snippets Groups Projects
Commit 176152b1 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

More attempts to fix windows hang

parent 8b9cc200
No related branches found
No related tags found
No related merge requests found
Pipeline #29176 canceled
......@@ -93,6 +93,8 @@ namespace ctpl {
size_t q_size() { return this->q.size(); }
void restart(int nThreads) { if (!this->isDone) this->stop(true); this->init(); this->resize(nThreads); }
// change the number of threads in the pool
// should be called from one thread, otherwise be careful to not interleave, also with this->stop()
// nThreads must be >= 0
......
......@@ -77,6 +77,8 @@ TEST_CASE( "Send and receiver via encoding" ) {
receiver->set("frameset_buffer_size", 0);
sender->setStream(&stream);
//ftl::pool.restart(4);
ftl::timer::start(false);
SECTION("a single data only frame") {
......@@ -109,12 +111,14 @@ TEST_CASE( "Send and receiver via encoding" ) {
REQUIRE( result->frames[0].get<int>(Channel::Control) == 57 );
}
//ftl::timer::stop(true);
ftl::timer::stop(true);
ftl::timer::reset();
ftl::timer::setInterval(50);
ftl::pool.clear_queue();
while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10));
//ftl::pool.stop(true);
delete receiver;
delete sender;
}
......@@ -146,6 +150,8 @@ TEST_CASE( "Multi-thread stability testing" ) {
sender->setStream(&stream);
sender->resetSender(); // FIXME: Why is this needed?
//ftl::pool.restart(4);
ftl::timer::setInterval(20);
ftl::timer::start(false);
......@@ -277,9 +283,12 @@ TEST_CASE( "Multi-thread stability testing" ) {
ftl::timer::reset();
ftl::timer::setInterval(50);
ftl::timer::stop(true);
ftl::pool.clear_queue();
while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10));
//ftl::pool.stop(true);
delete receiver;
delete sender;
}
......@@ -309,6 +318,8 @@ TEST_CASE( "Response via loopback" ) {
return true;
});
//ftl::pool.restart(4);
ftl::timer::start(false);
SECTION("a single data only frame") {
......@@ -343,11 +354,13 @@ TEST_CASE( "Response via loopback" ) {
REQUIRE( result->frames[0].get<int>(Channel::Control) == 1 );
}
//ftl::timer::stop(true);
ftl::timer::stop(true);
ftl::timer::reset();
ftl::timer::setInterval(50);
ftl::pool.clear_queue();
while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10));
//ftl::pool.clear_queue();
//while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10));
//ftl::pool.stop(true);
delete receiver;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment