FastLED 3.10.8
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 52 of file async_log_queue.cpp.hpp.

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