A simple shared counter. More...
#include <util.h>
Public Member Functions | |
uint32_t | operator() () |
Return the current count and increment the count. | |
void | reset () |
Reset count to zero. | |
uint32_t | value () const |
Return the current count value. | |
A simple shared counter.
Each time the operator() is called, it is incremented by 1. Calls from different threads are serialized through a mutual exclusion lock or an atomic operation. Currently, it only knows about atomic operations provided by GCC and visual studio on WIN32. The GCC automic functions are determined in the configure script.