RESOLVED FIXED 33878
Add ThreadSpecific for for ENABLE(SINGLE_THREADED)
https://bugs.webkit.org/show_bug.cgi?id=33878
Summary Add ThreadSpecific for for ENABLE(SINGLE_THREADED)
Kwang Yul Seo
Reported 2010-01-19 20:08:56 PST
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.
Attachments
Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED) (2.42 KB, patch)
2010-01-19 20:16 PST, Kwang Yul Seo
no flags
Kwang Yul Seo
Comment 1 2010-01-19 20:16:23 PST
Created attachment 46971 [details] Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)
Eric Seidel (no email)
Comment 2 2010-01-21 16:51:26 PST
I think Alexey is your best reviewer here.
Alexey Proskuryakov
Comment 3 2010-01-21 17:00:57 PST
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?
Kwang Yul Seo
Comment 4 2010-01-21 20:31:20 PST
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
Alexey Proskuryakov
Comment 5 2010-01-21 21:01:22 PST
Comment on attachment 46971 [details] Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED) ok, r=me
WebKit Commit Bot
Comment 6 2010-01-21 23:36:35 PST
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>
WebKit Commit Bot
Comment 7 2010-01-21 23:36:42 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.