| 67 | } |
| 68 | |
| 69 | void ThreadBase::stopThread() { |
| 70 | _run = false; |
| 71 | size_t timeout = 0u; |
| 72 | while (!_exit) { |
| 73 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
| 74 | ++timeout; |
| 75 | if (timeout > 50u) { |
| 76 | cancelThread(); |
| 77 | SI_LOG_DEBUG("%s: Thread did not stop within timeout? !!TIMEOUT!!", _name.c_str()); |
| 78 | break; |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void ThreadBase::cancelThread() { |
| 84 | pthread_cancel(_thread); |
nothing calls this directly
no outgoing calls
no test coverage detected