- // erasing events from the queue is evil
- //
- // example
- // queue = o o o d <o'> | d d d d:
- // ct = 1 2 3 4 5 6 7 8 9
- // d = dirty, o = other event
- //
- // We want to be sure o' is processed before continuing, hence we wait for
- // the processed counter >= 5. Due to dirty events being erased but still
- // counted, the event counter jumps from 4 to 8 when processing the first
- // dirty event. Event o' still not processed.
- //
- // Counting erased events results in m_processedEvents not really reflecting
- // processed events. Not counting events that can be erased, makes it more
- // difficult to compute the index when o' is procesed. It means we have
- // maintain a list of events that can be erased from the queue, and when
- // computing what m_processed will be when o' is processed, skip those
- //
- // queue = o o o d <o'> | d d d d o:
- // ct = 1 2 3 4 5