When ENABLE(SINGLE_THREADED) is true, ThreadSpecific can be replaced with a simple getter/setter. Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236, an implementation of ThreadSpecific must be available to build WebKit. This causes a build failure for platforms without a proper ThreadSpecific implementation.
Created attachment 46971 [details] Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)
I think Alexey is your best reviewer here.
The implementation looks fine, but I don't understand what ENABLE(SINGLE_THREADED) means. Is it about thread use in WebCore? If so, why do JSC-only changes made in bug 33236 make this patch necessary?
ENABLE(SINGLE_THREADED) is used mainly by Qt port and it means both JavaScriptCore and WebCore are single-threaded. As ThreadSpecific can be used by both JavaScriptCore and WebCore, checking only ENABLE(JSC_MULTIPLE_THREADS) is not correct here. Before 33236 is landed, ThreadSpecific was not used at all when some multi-threaded WebCore features such as database and workers are disabled. However, as the following code is added in 33236, an implementation of ThreadSpecific is required even for single-threaded WebKit build. #if ENABLE(JSC_MULTIPLE_THREADS) pthread_once_t createIdentifierTableSpecificOnce = PTHREAD_ONCE_INIT; static void createIdentifierTableSpecificCallback() { ASSERT(!g_identifierTableSpecific); g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>(); } void createIdentifierTableSpecific() { pthread_once(&createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback); ASSERT(g_identifierTableSpecific); } #else void createIdentifierTableSpecific() { ASSERT(!g_identifierTableSpecific); g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>(); } #endif
Comment on attachment 46971 [details] Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED) ok, r=me
Comment on attachment 46971 [details] Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED) Clearing flags on attachment: 46971 Committed r53682: <http://trac.webkit.org/changeset/53682>
All reviewed patches have been landed. Closing bug.