<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>33878</bug_id>
          
          <creation_ts>2010-01-19 20:08:56 -0800</creation_ts>
          <short_desc>Add ThreadSpecific for for ENABLE(SINGLE_THREADED)</short_desc>
          <delta_ts>2010-01-21 23:36:42 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Kwang Yul Seo">skyul</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>182592</commentid>
    <comment_count>0</comment_count>
    <who name="Kwang Yul Seo">skyul</who>
    <bug_when>2010-01-19 20:08:56 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182596</commentid>
    <comment_count>1</comment_count>
      <attachid>46971</attachid>
    <who name="Kwang Yul Seo">skyul</who>
    <bug_when>2010-01-19 20:16:23 -0800</bug_when>
    <thetext>Created attachment 46971
Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183386</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-01-21 16:51:26 -0800</bug_when>
    <thetext>I think Alexey is your best reviewer here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183398</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-01-21 17:00:57 -0800</bug_when>
    <thetext>The implementation looks fine, but I don&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183459</commentid>
    <comment_count>4</comment_count>
    <who name="Kwang Yul Seo">skyul</who>
    <bug_when>2010-01-21 20:31:20 -0800</bug_when>
    <thetext>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&lt;ThreadIdentifierTableData&gt;();
}
void createIdentifierTableSpecific()
{
    pthread_once(&amp;createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback);
    ASSERT(g_identifierTableSpecific);
}

#else

void createIdentifierTableSpecific()
{
    ASSERT(!g_identifierTableSpecific);
    g_identifierTableSpecific = new ThreadSpecific&lt;ThreadIdentifierTableData&gt;();
}

#endif</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183467</commentid>
    <comment_count>5</comment_count>
      <attachid>46971</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-01-21 21:01:22 -0800</bug_when>
    <thetext>Comment on attachment 46971
Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)

ok, r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183516</commentid>
    <comment_count>6</comment_count>
      <attachid>46971</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-21 23:36:35 -0800</bug_when>
    <thetext>Comment on attachment 46971
Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)

Clearing flags on attachment: 46971

Committed r53682: &lt;http://trac.webkit.org/changeset/53682&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183517</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-21 23:36:42 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>46971</attachid>
            <date>2010-01-19 20:16:23 -0800</date>
            <delta_ts>2010-01-21 23:36:35 -0800</delta_ts>
            <desc>Implement ThreadSpecific with a simple getter/setter for ENABLE(SINGLE_THREADED)</desc>
            <filename>ThreadSpecific.patch</filename>
            <type>text/plain</type>
            <size>2478</size>
            <attacher name="Kwang Yul Seo">skyul</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDUzNTE5KQorKysgSmF2Y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