
16 Dec
2011
16 Dec
'11
9:14 a.m.
On 12/15/2011 12:56 PM, Steven Watanabe wrote:
This needs to declare data_ready as mutable, so the compiler doesn't
Oops, I meant 'volatile'
cond.wait() does block, but spurious wakeups are allowed, hence the loop.
Where is that explained, I read, "If any threads are currently blocked waiting on *this in a call to wait or timed_wait, unblocks one of those threads. " It does not say anything like "and blocks the current thread...", along with some explanation of when it gets unblocked.
If the compiler doesn't know anything about condition variables, it will see an opaque function call that can potentially clobber any non-local variables.
I see, thanks.
It already exists.
Ah, I missed it.