MCPcopy Create free account
hub / github.com/Abc-Arbitrage/Disruptor-cpp / joinAllThreads

Method joinAllThreads

Disruptor.Tests/StubExecutor.cpp:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 void StubExecutor::joinAllThreads()
29 {
30 std::lock_guard< decltype(m_mutex) > lock(m_mutex);
31
32 while (!m_threads.empty())
33 {
34 boost::thread thread(std::move(m_threads.front()));
35 m_threads.pop_front();
36
37 if (thread.joinable())
38 {
39 try
40 {
41 thread.interrupt();
42 thread.timed_join(boost::posix_time::milliseconds(5000));
43 }
44 catch (std::exception& ex)
45 {
46 std::cout << ex.what() << std::endl;
47 }
48 }
49
50 BOOST_CHECK_MESSAGE(thread.joinable() == false, "Failed to stop thread: " << thread.get_id());
51 }
52 }
53
54 void StubExecutor::ignoreExecutions()
55 {

Callers 1

~DisruptorFixtureMethod · 0.80

Calls 2

emptyMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected