[Webkit-unassigned] [Bug 33878] Add ThreadSpecific for for ENABLE(SINGLE_THREADED)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 21 20:31:20 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33878





--- Comment #4 from Kwang Yul Seo <kwangyul.seo at gmail.com>  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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list