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