Event counter (source code)

= Event counter

An <event counter> records a number of observed events, unlike a <single-bit event latch> which records only whether any event occurred. A software <event counter> shared with an <interrupt handler> needs atomic updates or a suitable <critical section>. Its finite capacity imposes a maximum backlog unless overflow is handled explicitly.