Changeset 249064 in webkit
- Timestamp:
- Aug 23, 2019, 1:31:08 PM (7 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
wtf/MainThread.h (modified) (1 diff)
-
wtf/RefCounted.h (modified) (2 diffs)
-
wtf/cocoa/MainThreadCocoa.mm (modified) (2 diffs)
-
wtf/generic/MainThreadGeneric.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r249059 r249064 1 2019-08-23 Chris Dumez <cdumez@apple.com> 2 3 Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized 4 https://bugs.webkit.org/show_bug.cgi?id=201083 5 6 Reviewed by Alex Christensen. 7 8 An assertion is hit in isMainThread() for some clients using WTF because the main thread is not initialized, since r248533. 9 Clients can work around this by calling WTF::initializeMainThread() before using WTF but it seems unfortunate to force them 10 to do so. I propose we disable the assertion until the main thread is initialized. 11 12 * wtf/MainThread.h: 13 * wtf/RefCounted.h: 14 (WTF::RefCountedBase::RefCountedBase): 15 (WTF::RefCountedBase::applyRefDerefThreadingCheck const): 16 * wtf/cocoa/MainThreadCocoa.mm: 17 (WTF::isMainThreadInitialized): 18 * wtf/generic/MainThreadGeneric.cpp: 19 (WTF::isMainThreadInitialized): 20 1 21 2019-08-21 Jiewen Tan <jiewen_tan@apple.com> 2 22 -
trunk/Source/WTF/wtf/MainThread.h
r247461 r249064 55 55 WTF_EXPORT_PRIVATE bool isMainThread(); 56 56 WTF_EXPORT_PRIVATE bool isMainThreadIfInitialized(); 57 WTF_EXPORT_PRIVATE bool isMainThreadInitialized(); 57 58 58 59 WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(Thread&); -
trunk/Source/WTF/wtf/RefCounted.h
r248544 r249064 92 92 : m_refCount(1) 93 93 #if !ASSERT_DISABLED 94 , m_isOwnedByMainThread(isMainThread()) 94 , m_isOwnedByMainThread(isMainThreadIfInitialized()) 95 , m_areThreadingChecksEnabled(isMainThreadInitialized()) 95 96 #endif 96 97 #if CHECK_REF_COUNTED_LIFECYCLE … … 106 107 if (hasOneRef()) { 107 108 // Likely an ownership transfer across threads that may be safe. 108 m_isOwnedByMainThread = isMainThread ();109 m_isOwnedByMainThread = isMainThreadIfInitialized(); 109 110 } else if (areThreadingChecksEnabledGlobally && m_areThreadingChecksEnabled) { 110 111 // If you hit this assertion, it means that the RefCounted object was ref/deref'd -
trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm
r243795 r249064 182 182 } 183 183 184 bool isMainThreadInitialized() 185 { 186 return true; 187 } 188 184 189 bool isUIThread() 185 190 { … … 240 245 } 241 246 247 bool isMainThreadInitialized() 248 { 249 return mainThreadEstablishedAsPthreadMain || mainThreadPthread; 250 } 251 242 252 #endif // USE(WEB_THREAD) 243 253 -
trunk/Source/WTF/wtf/generic/MainThreadGeneric.cpp
r248546 r249064 93 93 } 94 94 95 bool isMainThreadInitialized() 96 { 97 return true; 98 } 99 95 100 void scheduleDispatchFunctionsOnMainThread() 96 101 {
Note:
See TracChangeset
for help on using the changeset viewer.