for (; !Free; ) ; ????
-
for (; !Free; ) ; Free = FALSE;
what does the for loop means! I only see for(; ; ) not the above. Thanksit is the same as while(!Free) for (initialize ; test ; increment)
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill." -- Umberto Eco, Foucault's Pendulum
-
for (; !Free; ) ; Free = FALSE;
what does the for loop means! I only see for(; ; ) not the above. ThanksAs Chris pointed out, this is equivalent to
while(!Free); //keep looping
This makes little sense except in a multithreaded context where you're expecting some other thread to release a resource marked by
Free
. In fact, the snippet looks like a (very badly behaved) simulacre ofEnterCriticalSection
. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
As Chris pointed out, this is equivalent to
while(!Free); //keep looping
This makes little sense except in a multithreaded context where you're expecting some other thread to release a resource marked by
Free
. In fact, the snippet looks like a (very badly behaved) simulacre ofEnterCriticalSection
. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
for (; !Free; ) ; Free = FALSE;
what does the for loop means! I only see for(; ; ) not the above. ThanksWatch that line! You've got a ; (semicolon) right after. You'll be in an endless loop, and
Free
will never get set toFALSE
:while (TRUE == Free)
{
Free = FALSE;
}Seems redundant, but I explicitly test for
TRUE
because who knows what magic numbers (#define
d) mean.;P -- ian