Mutex may be freed too late in NetworkCache::Storage::traverse
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2017 13:08:46 +0000 (13:08 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2017 13:08:46 +0000 (13:08 +0000)
commit71de147833a388c8a9ddd1a093876d56e9623b47
tree0501f5baaa6ec670893ab7a4a93440dada09a4c2
parent1b5fda79481d2ea2b07512c1bd646835f5655da9
Mutex may be freed too late in NetworkCache::Storage::traverse
https://bugs.webkit.org/show_bug.cgi?id=170400
<rdar://problem/30515865>

Reviewed by Carlos Garcia Campos and Andreas Kling.

Fix a race.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::traverse):

    Ensure the mutex is not accessed after we dispatch to the main thread.
    The main thread call deletes the owning TraverseOperation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp