MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_container_mt_stop

Function test_container_mt_stop

cpp/src/container_test.cpp:487–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487void test_container_mt_stop() {
488 test_mt_handler th;
489 proton::container c(th);
490 c.auto_stop(false);
491 container_runner runner(c);
492 auto t = std::thread(runner);
493 // Must ensure that thread is joined
494 try {
495 test_listen_handler lh;
496 ASSERT_EQUAL("start", th.wait());
497 c.listen("//:0", lh); // Also opens a connection
498 ASSERT_EQUAL("open", th.wait());
499 c.stop();
500 t.join();
501 } catch (const std::exception& e) {
502 std::cerr << FAIL_MSG(e.what()) << std::endl;
503 // If join hangs, let the test die by timeout. We cannot
504 // detach and continue: deleting the container while t is
505 // still alive will put the process in an undefined state.
506 t.join();
507 throw;
508 }
509}
510
511class test_mt_handler_wq : public test_mt_handler {
512public:

Callers 1

mainFunction · 0.85

Calls 6

joinMethod · 0.80
waitMethod · 0.65
auto_stopMethod · 0.45
listenMethod · 0.45
stopMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected