38 #ifdef USE_MULTITHREAD
40 #include "ac/spinlock.h"
55 virtual bool bGetFirst(T& TReturn)
const = 0;
56 virtual bool bGetNext(T& TReturn)
const = 0;
79 void Init(
const T* p,
unsigned i)
135 #ifdef USE_MULTITHREAD
145 mutable volatile AO_TS_t inuse;
148 InUse(
void) : inuse(AO_TS_INITIALIZER) {
NO_OP; };
149 virtual ~InUse(
void) {
NO_OP; };
151 inline bool bIsInUse(
void)
const
160 return (mbdyn_test_and_set(&inuse) == AO_TS_CLEAR);
162 inline void ReSetInUse() { AO_CLEAR(&inuse); };
168 class MT_VecIter :
public VecIter<T> {
171 mutable unsigned iCount;
176 MT_VecIter(
const T* p,
unsigned i) :
VecIter<T>(p, i)
181 virtual ~MT_VecIter(
void)
187 void ResetAccessData(
void)
192 for (
unsigned i = 0; i < VecIter<T>::iSize; i++) {
211 inline bool bGetCurr(T& TReturn)
const
228 inline bool bGetNext(T& TReturn)
const
248 silent_cerr(
"[" << pthread_self() <<
"]: total=" << iCount
virtual bool bGetNext(T &TReturn) const =0
bool bGetNext(T &TReturn) const
virtual bool bGetFirst(T &TReturn) const =0
#define ASSERT(expression)
bool bGetCurr(T &TReturn) const
void Init(const T *p, unsigned i)
bool bGetFirst(T &TReturn) const
VecIter(const T *p, unsigned i)