TextBreakIterator's character break cache is weird. Added here (fixed a bit after): https://bugs.webkit.org/attachment.cgi?id=144118&action=prettypatch Updated to never use a lock, and always use weak cmpxchg here: https://bugs.webkit.org/attachment.cgi?id=261719&action=prettypatch It's just trying to reduce the number of times it calls into ICU to initialize a UBRK_CHARACTER. The implementation keeps a one-element cache of the latest used one, which threads can optimistically grab. Failure is fine (just create a new one), same for failure to cache (just destroy it), but the logic is odd and you technically need release / acquire semantics because the UBRK_CHARACTER creation's store need to be visible on acquisition (but realistically it was created and then used and *then* cached, so it's probably been long ago enough that read reorders never manifested).
Created attachment 288901 [details] patch Note that this still leaks any cached instance on shutdown, but it didn't matter before so likely doesn't now. It's also not a good fit for std::once_flag + std::call_once because IIUC multiple threads can't use the instance concurrently (the cache just passes it around, loaning it to *one* thread at a time).
Comment on attachment 288901 [details] patch r=me
Comment on attachment 288901 [details] patch Clearing flags on attachment: 288901 Committed r205995: <http://trac.webkit.org/changeset/205995>
All reviewed patches have been landed. Closing bug.