[webkit-reviews] review granted: [Bug 211201] Freezing of Gigacage and JSC Configs should be thread safe. : [Attachment 397992] proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 29 13:32:54 PDT 2020


Yusuke Suzuki <ysuzuki at apple.com> has granted Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 211201: Freezing of Gigacage and JSC Configs should be thread safe.
https://bugs.webkit.org/show_bug.cgi?id=211201

Attachment 397992: proposed patch.

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




--- Comment #4 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 397992
  --> https://bugs.webkit.org/attachment.cgi?id=397992
proposed patch.

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

Discussed with Mark. We actually want to call this function multiple times, so
std::call_once is not suitable. But while executing this function, this
function breaks an invariant temporarily which is required by the call from the
other thread. So guarding this with Lock is the appropriate way.

>> Source/JavaScriptCore/runtime/JSCConfig.cpp:58
>> +	LockHolder locker(configLock);
> 
> Why not using std::call_once?

Use `auto locker = holdLock(configLock)` in WTF.


More information about the webkit-reviews mailing list