| 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 | { |
no test coverage detected