Summary: | Add ThreadSpecific for for ENABLE(SINGLE_THREADED) | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kwang Yul Seo <skyul> | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, commit-queue, eric | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Kwang Yul Seo
2010-01-19 20:08:56 PST
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. |