MCPcopy Create free account
hub / github.com/VitalAudio/visage / waitForEnd

Method waitForEnd

visage_utils/thread_utils.h:90–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 void setThreadTask(std::function<void()> task) { task_ = std::move(task); }
89
90 bool waitForEnd(int ms_timeout) {
91 long long ms_start = time::milliseconds();
92 while (!completed()) {
93 if (time::milliseconds() - ms_start > ms_timeout)
94 return false;
95
96 sleep(5);
97 }
98 stop();
99 return true;
100 }
101
102 const std::string& name() const { return name_; }
103 bool shouldRun() const { return should_run_.load(); }

Callers 1

Calls 1

millisecondsFunction · 0.85

Tested by

no test coverage detected