FastLED 3.10.6
Loading...
Searching...
No Matches

◆ depth()

size_t fl::net::ble::BleNotifyQueue::depth ( ) const
inline

Number of complete payloads queued, including the one in flight.

Definition at line 105 of file ble_notify_queue.h.

105 {
106 const size_t head = mHead;
107 const size_t tail = mTail;
108 return (tail + kSlots - head) % kSlots;
109 }
static constexpr size_t kSlots
One spare slot keeps "empty" and "full" distinguishable without a shared count, which is what makes t...
volatile size_t mHead
Owned by the consumer; read by the producer to detect "full".
volatile size_t mTail
Owned by the producer; read by the consumer to detect "empty".

References kSlots, mHead, and mTail.