Changeset 246652 in webkit
- Timestamp:
- Jun 20, 2019 1:39:29 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246649 r246652 1 2019-06-20 Brent Fulgham <bfulgham@apple.com> 2 3 Resolve frequent crashes in topPrivatelyControlledDomain 4 https://bugs.webkit.org/show_bug.cgi?id=199072 5 <rdar://problem/51428162> 6 7 Reviewed by Youenn Fablet. 8 9 Crash data indicates that we are frequently crashing when multiple threads call 10 WebCore::topPrivatelyControlledDomain. 11 12 Code review showed the potential for a thread contention issue, since WebKit builds 13 with '--fno-threadsafe-statics'. 14 15 This patch corrects the thread safety issue in WebCore::topPrivatelyControlledDomain. 16 17 * platform/mac/PublicSuffixMac.mm: 18 (WebCore::topPrivatelyControlledDomain): Only instantiate the static cache after the 19 current thread has achieved its lock. 20 1 21 2019-06-20 Saam Barati <sbarati@apple.com> 2 22 -
trunk/Source/WebCore/platform/mac/PublicSuffixMac.mm
r238771 r246652 51 51 return domain; 52 52 53 static Lock cacheLock; 54 auto locker = holdLock(cacheLock); 55 53 56 static NeverDestroyed<HashMap<String, String, ASCIICaseInsensitiveHash>> cache; 54 static Lock cacheLock;55 57 56 58 auto isolatedDomain = domain.isolatedCopy(); 57 58 auto locker = holdLock(cacheLock); 59 59 60 60 constexpr auto maximumSizeToPreventUnlimitedGrowth = 128; 61 61 if (cache.get().size() == maximumSizeToPreventUnlimitedGrowth)
Note: See TracChangeset
for help on using the changeset viewer.