use Sleep function, if you are working under Windows. There is something similar in unix too, but I can't remember the function name... Could be the same, or delay() or something like that. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal... once stated: methane@personal.ro
You have a while loop, ending only if flag != 1.
Is flag set to semething else in the code after the wait function? In that case you must use Sleep ( ) to wait, like Nosferatu suggested.
But, if flag is set to semething else by a different thread, it might be better to use some of the synchronisation API calls, like a critical section or a mutex.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.