[webkit-reviews] review granted: [Bug 211036] Use `static Lock` instead of `static NeverDestroyed<Lock>` : [Attachment 397601] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Apr 25 17:38:20 PDT 2020
Darin Adler <darin at apple.com> has granted Yusuke Suzuki <ysuzuki at apple.com>'s
request for review:
Bug 211036: Use `static Lock` instead of `static NeverDestroyed<Lock>`
https://bugs.webkit.org/show_bug.cgi?id=211036
Attachment 397601: Patch
https://bugs.webkit.org/attachment.cgi?id=397601&action=review
--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 397601
--> https://bugs.webkit.org/attachment.cgi?id=397601
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=397601&action=review
> Source/WTF/ChangeLog:8
> + Lock can be static-initialized since it has constexpr constructor.
No need to use NeverDestroyed<Lock>.
Patch is correct, but this comment is wrong.
It’s true that we don’t need NeverDestroyed with Lock! But it has nothing to do
with the constructor. NeverDestroyed is about the *destructor*.
The constexpr constructor means we can have global initialized Lock objects
outside a function. Not what we are changing here, though.
More information about the webkit-reviews
mailing list