OKlibrary  0.2.1.6
OKlib::Parallelism::CounterWithMutex< N > Class Template Reference

Publically derived from Counter, provides mutex-functionality. More...

#include <ExperimentalThreads.hpp>

Inheritance diagram for OKlib::Parallelism::CounterWithMutex< N >:
OKlib::Parallelism::Counter< N >

List of all members.

Public Member Functions

 CounterWithMutex (const uint_type n, boost::mutex &m)
 CounterWithMutex (const CounterWithMutex &c)
void operator() () const

Detailed Description

template<int N>
class OKlib::Parallelism::CounterWithMutex< N >

Publically derived from Counter, provides mutex-functionality.

Only for objects created by the copy-constructor the pointer lock is valid. Invariant: If locked is true, then lock.get() is valid.

Bug:
The problem likely is that after a copy-operation the copied object becomes invalid!
Todo:

Document the class (what's the point of the strange design?).

Can assertions be made about member mutex?

Definition at line 74 of file ExperimentalThreads.hpp.


Constructor & Destructor Documentation

template<int N>
OKlib::Parallelism::CounterWithMutex< N >::CounterWithMutex ( const uint_type  n,
boost::mutex &  m 
) [inline]

Definition at line 85 of file ExperimentalThreads.hpp.

template<int N>
OKlib::Parallelism::CounterWithMutex< N >::CounterWithMutex ( const CounterWithMutex< N > &  c) [inline]

Definition at line 89 of file ExperimentalThreads.hpp.


Member Function Documentation

template<int N>
void OKlib::Parallelism::CounterWithMutex< N >::operator() ( ) const [inline]

Reimplemented from OKlib::Parallelism::Counter< N >.

Definition at line 96 of file ExperimentalThreads.hpp.


The documentation for this class was generated from the following file: