Changeset 214786 in webkit
- Timestamp:
- Apr 3, 2017 6:08:46 AM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r214723 r214786 1 2017-04-03 Antti Koivisto <antti@apple.com> 2 3 Mutex may be freed too late in NetworkCache::Storage::traverse 4 https://bugs.webkit.org/show_bug.cgi?id=170400 5 <rdar://problem/30515865> 6 7 Reviewed by Carlos Garcia Campos and Andreas Kling. 8 9 Fix a race. 10 11 * NetworkProcess/cache/NetworkCacheStorage.cpp: 12 (WebKit::NetworkCache::Storage::traverse): 13 14 Ensure the mutex is not accessed after we dispatch to the main thread. 15 The main thread call deletes the owning TraverseOperation. 16 1 17 2017-04-01 Dan Bernstein <mitz@apple.com> 2 18 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
r214101 r214786 860 860 }); 861 861 }); 862 // Wait for all reads to finish. 863 std::unique_lock<Lock> lock(traverseOperation.activeMutex); 864 traverseOperation.activeCondition.wait(lock, [&traverseOperation] { 865 return !traverseOperation.activeCount; 866 }); 862 { 863 // Wait for all reads to finish. 864 std::unique_lock<Lock> lock(traverseOperation.activeMutex); 865 traverseOperation.activeCondition.wait(lock, [&traverseOperation] { 866 return !traverseOperation.activeCount; 867 }); 868 } 867 869 RunLoop::main().dispatch([this, &traverseOperation] { 868 870 traverseOperation.handler(nullptr, { });
Note: See TracChangeset
for help on using the changeset viewer.