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

Method stopThread

src/base/ThreadBase.cpp:69–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected