Simple synchronized counter. More...
#include <threadsafe_counter.h>

Public Member Functions | |
| threadsafe_counter (void) throw () | |
| long | increment (void) throw () |
| returns the authoritative count after the increment | |
| long | decrement (void) throw () |
| returns the authoritative count after the decrement | |
| long | getCount (void) const throw () |
| currently non-authoritative! Not sure of a use case where that would help (other threads can change the count anyway) | |
Simple synchronized counter.
Handy for any sort of counting that needs to be bumped up/down by different threads.
Definition at line 47 of file threadsafe_counter.h.
| threadsafe_counter::threadsafe_counter | ( | void | ) | throw () [inline] |
Definition at line 49 of file threadsafe_counter.h.
| long threadsafe_counter::increment | ( | void | ) | throw () [inline] |
returns the authoritative count after the increment
Definition at line 54 of file threadsafe_counter.h.
| long threadsafe_counter::decrement | ( | void | ) | throw () [inline] |
returns the authoritative count after the decrement
Definition at line 61 of file threadsafe_counter.h.
| long threadsafe_counter::getCount | ( | void | ) | const throw () [inline] |
currently non-authoritative! Not sure of a use case where that would help (other threads can change the count anyway)
Definition at line 69 of file threadsafe_counter.h.
1.7.1