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

◆ tryPop()

template<fl::size DescriptorCount, fl::size ArenaSize>
bool fl::AsyncLogQueue< DescriptorCount, ArenaSize >::tryPop ( const char ** outPtr,
fl::u16 * outLen )

Consumer: Try to pop one message (main thread only)

Definition at line 51 of file async_log_queue.cpp.hpp.

51 {
52 // Read head with memory barrier (acquire semantics)
55
56 if (tail == head) {
57 return false; // Queue empty
58 }
59
60 // Read descriptor at tail position
62
63 // Return pointer into arena (contiguous due to padding at wrap)
64 *outPtr = &mArena[desc.mStartIdx];
65 *outLen = desc.mLength;
66
67 return true;
68}
volatile fl::u32 mTail
Consumer read position (descriptor ring)
Descriptor mDescriptors[DescriptorCount]
Ring of message descriptors.
char mArena[ArenaSize]
String storage arena.
High-performance SPSC async log queue.
Descriptor for one log message.