Skip to content
  • Deucе's avatar
    Remove RINGBUF_SEM for RINGBUG_EVENT · d0760706
    Deucе authored
    We've never really cared how many times the ring buffer has become
    empty, how many times data was added to it, or how many times we've
    been over the highwater mark.  These have effectively always been
    event signalling, with extra hackiness to clear "extra" semaphore
    posts.
    
    This commit removes RINGBUF_SEM entirely, and uses events for
    everything.  There's an empty event (set when the ring buffer is empty),
    a data event (set when the ring buffer is not empty), and a highwater
    event (set when the ring buffer has at least highwater mark bytes).
    
    A RingBufWrite() will set data and highwater events if applicable,
    and clear the empty event.
    
    A RingBufRead() will set empty event and clear data and highwater
    events if applicable.
    
    RingBufReInit() will now set the empty event, and clear the data
    and highwater events.
    
    These are the only actions the RingBuf API will perform on the
    events, it does *not* clear the highwater event on a RingBufWrite()
    if the buffer does not have eno...
    d0760706