[webkit-reviews] review granted: [Bug 223033] cachedCGColor() is not thread-safe : [Attachment 426288] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 17 20:52:28 PDT 2021


Darin Adler <darin at apple.com> has granted Said Abou-Hallawa
<sabouhallawa at apple.com>'s request for review:
Bug 223033: cachedCGColor() is not thread-safe
https://bugs.webkit.org/show_bug.cgi?id=223033

Attachment 426288: Patch

https://bugs.webkit.org/attachment.cgi?id=426288&action=review




--- Comment #14 from Darin Adler <darin at apple.com> ---
Comment on attachment 426288
  --> https://bugs.webkit.org/attachment.cgi?id=426288
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426288&action=review

Is the additional slowness from a lock in this function acceptable?

> Source/WebCore/platform/graphics/cg/ColorCG.cpp:128
> +    static Lock cachedCGColorLock;
> +    LockHolder lockHolder(&cachedCGColorLock);

I suggest locking *after* the fast path special cases for transparentBlack,
black, and white. The lock is not needed for that code.


More information about the webkit-reviews mailing list