<div dir="ltr">The waitForChange member function in ThreadSafeInteger class will call pthread_cond_wait in pthread or SleepConditionVariableCS in Windows in an IF statement, but as the following:<div><br></div><div><a href="http://stackoverflow.com/questions/10595363/pthread-cond-wait-without-a-while-loop">http://stackoverflow.com/questions/10595363/pthread-cond-wait-without-a-while-loop</a><br></div><div><br></div><div><a href="http://stackoverflow.com/questions/1136371/pthread-and-wait-conditions">http://stackoverflow.com/questions/1136371/pthread-and-wait-conditions</a><br></div><div><br></div><div>the condition should be in a while loop, not in an if statement.</div><div><br></div><div>Is right to change the if into while?</div><div><br></div><div>Thanks!</div></div>