MCPcopy Create free account
hub / github.com/FastLED/FastLED / remove_handler

Method remove_handler

src/platforms/stub/isr_stub.hpp:144–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142 }
143
144 void remove_handler(stub_isr_handle_data* handler) FL_NOEXCEPT {
145 fl::unique_lock<fl::mutex> lock(mMutex) FL_NOEXCEPT;
146
147 // Remove from vector
148 for (size_t i = 0; i < mHandlers.size(); ++i) {
149 if (mHandlers[i] == handler) {
150 mHandlers.erase(mHandlers.begin() + i);
151 break;
152 }
153 }
154
155 // Stop thread if no more handlers
156 if (mHandlers.empty() && mTimerThread) {
157 mShouldStop = true;
158 mCondVar.notify_one(); // Wake the thread so it can exit
159 lock.unlock(); // Unlock before joining
160 if (mTimerThread->joinable()) {
161 mTimerThread->join();
162 }
163 mTimerThread.reset();
164 }
165 }
166
167 ~TimerThreadManager() {
168 if (mTimerThread) {

Callers 1

stub_detach_handlerFunction · 0.80

Calls 8

joinableMethod · 0.80
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45
notify_oneMethod · 0.45
unlockMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected