[webkit-dev] How much does webkit rely on non-recursive mutex?

Yong Li yong.li.webkit at gmail.com
Fri May 28 12:14:38 PDT 2010


Hi, All,

I've noticed that webkit is using ASSERT(!mutex.tryLock()) in many
places asserting the mutex is already locked. However this introduces
a hidden assumption that WebKit Mutex is not recursive. I haven't
found any other place that depends on this assumption. Have anyone
seen one? If this assumption is only used in assertions, I think it
would probably be better to use a boolean flag in #ifndef NDEBUG and
ASSERT(mutex.isLocked()), so we can remove this unnecessary
assumption. Otherwise, we should make it clear that WebKit Mutex must
be non-recursive. I've opened a bug for ThreadingPthread to explicitly
use PTHREAD_MUTEX_NORMAL:
https://bugs.webkit.org/show_bug.cgi?id=39893

Best regards,

Yong Li


More information about the webkit-dev mailing list