FastLED 3.9.15
Loading...
Searching...
No Matches

◆ removeId()

bool fl::IdTracker::removeId ( void * ptr)

Remove tracking for a pointer.

Thread-safe.

Parameters
ptrPointer to stop tracking
Returns
true if pointer was being tracked and removed, false if not found

Definition at line 47 of file id_tracker.cpp.

47 {
48 if (!ptr) {
49 return false;
50 }
51
52 // Lock for thread safety
53 mMutex.lock();
54
55 bool removed = mPointerToId.erase(ptr);
56
57 mMutex.unlock();
58 return removed;
59}
fl::hash_map< void *, int > mPointerToId
Definition id_tracker.h:92
fl::mutex mMutex
Definition id_tracker.h:89

References mMutex, and mPointerToId.