[webkit-dev] PSA: you should use WTF::Lock and WTF::Condition instead of WTF::SpinLock, WTF::Mutex, WTF::ThreadCondition, std::mutex, std::condition_variable, or std::condition_variable_any

Maciej Stachowiak mjs at apple.com
Fri Aug 21 20:20:22 PDT 2015


> On Aug 21, 2015, at 12:11 PM, Michael Catanzaro <mcatanzaro at igalia.com> wrote:
> 
> On Wed, 2015-08-19 at 13:08 -0700, Filip Pizlo wrote:
>> TL;DR.  Don’t use WTF::SpinLock, WTF::Mutex, std::mutex,
>> WTF::ThreadCondition, std::condition_variable, or
>> std::condition_variable_any.  They waste CPU time and they waste
>> memory.  Use WTF::Lock and WTF::Condition instead.
> 
> Hi, I recommend adding a style-checker rule to enforce this, if you
> haven't already.

I wonder also if we can get rid of all use of the old options. Then there would be no need for a style checker rule, we'd just delete them. Maybe a good starter project, if someone wants to learn a bit about WebKit.

 - Maciej




More information about the webkit-dev mailing list