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

◆ counting_semaphore

template<ptrdiff_t LeastMaxValue = 1>
using fl::counting_semaphore = fl::platforms::counting_semaphore<LeastMaxValue>

Counting semaphore abstraction for FastLED.

This is a platform-independent counting semaphore wrapper that delegates to:

  • fl::platforms::counting_semaphore (std::counting_semaphore or mutex/cv-based) on multithreaded platforms
  • fl::platforms::CountingSemaphoreFake (synchronous, non-blocking) on single-threaded platforms

Usage:

fl::counting_semaphore<10> sem(5); // Max value 10, initial count 5
sem.acquire(); // Decrement count (blocks if count == 0 on multithreaded platforms)
sem.release(); // Increment count
fl::platforms::counting_semaphore< LeastMaxValue > counting_semaphore
Counting semaphore abstraction for FastLED.
Definition semaphore.h:28

Definition at line 28 of file semaphore.h.