On Dec 15, 2010, at 11:11 AM, Steve Block wrote:

> Thanks for the reply Brady.
> 
>> The boolean in question isn't both checked and set at the same time - it's 
>> not an acquired resource.  One
>> thread sets it, the other checks it.
> I don't follow. If it's set from one thread and checked from another
> thread without locks, how can you guarantee this (other than with
> application logic)?

I don't understand your question - "how can you guarantee this?"

>> Additionally, while there isn't a guard specifically around the boolean, 
>> there is the "m_syncLock" Mutex
>> which is implicitly guarding operations on this bool, so the "thread safety 
>> of a bool?" argument becomes
>> somewhat moot.
> Ah, so you're saying that there's application logic using m_syncLock
> to prevent the boolean from being written and read at the same time? I
> didn't spot that.

It doesn't matter if it's written and read at the same time in this case - but 
after every write on the main thread, the background thread is signaled to 
read, so that read will always happen after the write.

~Brady

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to