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

Method release

src/platforms/arm/rp/semaphore_rp.cpp.hpp:70–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69template<ptrdiff_t LeastMaxValue>
70void CountingSemaphoreRP<LeastMaxValue>::release(ptrdiff_t update) {
71 FL_ASSERT(update >= 0, "CountingSemaphoreRP: release update must be non-negative");
72 FL_ASSERT(mSpinlock != nullptr, "CountingSemaphoreRP::release() called on null semaphore");
73
74 spin_lock_t* spinlock = static_cast<spin_lock_t*>(mSpinlock);
75
76 // Acquire spinlock to protect count manipulation
77 u32 save = spin_lock_blocking(spinlock);
78
79 // Check if we would exceed max value
80 if (mCount + update > mMaxValue) {
81 spin_unlock(spinlock, save);
82 FL_ASSERT(false, "CountingSemaphoreRP: release would exceed max value");
83 return;
84 }
85
86 mCount += update;
87
88 // Release spinlock
89 spin_unlock(spinlock, save);
90}
91
92template<ptrdiff_t LeastMaxValue>
93void CountingSemaphoreRP<LeastMaxValue>::acquire() {

Callers 8

AVRUSART1SPIOutputClass · 0.45
AVRUSART0SPIOutputClass · 0.45
attach_timer_handlerFunction · 0.45
attach_timer_handlerFunction · 0.45
attach_external_handlerFunction · 0.45
attach_timer_handlerFunction · 0.45
attach_external_handlerFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected