Bug 208672 - Make it possible to safely access CALayers and PlatformCALayerCocoa objects on the scrolling thread
Summary: Make it possible to safely access CALayers and PlatformCALayerCocoa objects o...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-05 16:12 PST by Simon Fraser (smfr)
Modified: 2021-05-20 19:13 PDT (History)
14 users (show)

See Also:


Attachments
Patch (9.43 KB, patch)
2020-03-05 16:20 PST, Simon Fraser (smfr)
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2020-03-05 16:12:40 PST
Make it possible to safely access CALayers and PlatformCALayerCocoa objects on the scrolling thread
Comment 1 Simon Fraser (smfr) 2020-03-05 16:20:59 PST
Created attachment 392644 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-03-05 16:21:21 PST
<rdar://problem/60106163>
Comment 3 Tim Horton 2020-03-05 19:44:43 PST
Comment on attachment 392644 [details]
Patch

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

> Source/WebCore/ChangeLog:13
> +        when pushing GraphicsLayer changes to CA, and when destroying GraphicsLayers which tears down their associated

What about PlatformCALayerCustom... are we sure they're not mutated in other cases than these?

> Source/WebCore/page/scrolling/ScrollingTree.h:220
> +private:

Why? This was already the case
Comment 4 Antti Koivisto 2020-03-06 08:17:00 PST
Comment on attachment 392644 [details]
Patch

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

> Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:88
> +static Lock& layerToPlatformLayerMapMutex()
> +{
> +    static LazyNeverDestroyed<Lock> mutex;
> +    static std::once_flag initializeMutex;
> +    std::call_once(initializeMutex, [] {
> +        mutex.construct();
> +    });
> +    return mutex.get();
> +}

I think you can just do 

static Lock lock;
Comment 5 Simon Fraser (smfr) 2020-03-06 11:07:39 PST
https://trac.webkit.org/changeset/258006/webkit