Works on debug but not release

Posted by user146780 on Stack Overflow See other posts from Stack Overflow or by user146780
Published on 2010-06-02T03:34:45Z Indexed on 2010/06/02 3:43 UTC
Read the original article Hit count: 167

Filed under:
|
|
|

I have a thread that sets a value to true when it is done. Until then I wait:

while(1)
{
    if(done[0] == true)
    {

        break;
    }
}

This code works just fine in Debug but in Release it stays in the loop forever even though the debugger clearly says that it is true and not false.

Why would this not work?

Thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about c