Arc::SimpleCounter Class Reference

#include <Thread.h>

Public Member Functions

virtual int inc (void)
virtual int dec (void)
virtual int get (void) const
virtual int set (int v)
virtual void wait (void) const
virtual bool wait (int t) const
virtual void forceReset (void)

Detailed Description

Thread-safe counter with capability to wait for zero value. It is extendable through re-implementation of virtual methods.


Member Function Documentation

virtual int Arc::SimpleCounter::dec ( void   )  [virtual]

Decrement value of counter.

Returns new value. Does not go below 0 value.

virtual void Arc::SimpleCounter::forceReset ( void   )  [inline, virtual]

This method is meant to be used only after fork.

It resets state of all internal locks and variables.

virtual int Arc::SimpleCounter::inc ( void   )  [virtual]

Increment value of counter.

Returns new value.

virtual int Arc::SimpleCounter::set ( int  v  )  [virtual]

Set value of counter.

Returns new value.

virtual bool Arc::SimpleCounter::wait ( int  t  )  const [virtual]

Wait for zero condition no longer than t milliseconds.

If t is negative - wait forever.


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:22 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3