MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / stopThread

Method stopThread

src/base/Thread.cpp:67–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void Thread::stopThread() {
68 if (_state == State::Unknown) {
69 return;
70 }
71 _state = State::Stopping;
72 size_t timeout = 0u;
73 while (_state != State::Stopped) {
74 std::this_thread::sleep_for(std::chrono::milliseconds(100));
75 ++timeout;
76 if (timeout > 50u) {
77 cancelThread();
78 SI_LOG_DEBUG("%s: Thread did not stop within timeout? !!TIMEOUT!!", _name.c_str());
79 break;
80 }
81 }
82 }
83
84 void Thread::pauseThread() {
85 _state = State::Pausing;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected