<?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>27759</bug_id>
          
          <creation_ts>2009-07-28 01:38:15 -0700</creation_ts>
          <short_desc>[V8] DOMData needs AtomicallyInitializedStatic</short_desc>
          <delta_ts>2014-12-16 00:48:17 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>1</everconfirmed>
          <reporter name="Adam Barth">abarth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>antonm</cc>
    
    <cc>arv</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>135138</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-07-28 01:38:15 -0700</bug_when>
    <thetext>&gt; +
&gt; +DOMData* DOMData::getCurrent()
&gt; +{
&gt; +    if (WTF::isMainThread())
&gt; +        return getCurrentMainThread();
&gt; +
&gt; +    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;ChildThreadDOMData&gt;, childThreadDOMData, ());

This looks like it has race conditions.  Please add a comment about why it
isn&apos;t or consider switching to using AtomicallyInitializedStatic (from
wtf/Threading.h).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135139</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-07-28 01:38:54 -0700</bug_when>
    <thetext>I should say that those words in the issue report are Dave Levin&apos;s.  I don&apos;t understand the issue yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135140</commentid>
    <comment_count>2</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-28 01:53:00 -0700</bug_when>
    <thetext>This one too:

&gt; Index: WebCore/bindings/v8/DOMData.h
&gt; +WTF::Mutex&amp; DOMDataStore::allStoresMutex()
&gt; +{
&gt; +    DEFINE_STATIC_LOCAL(WTF::Mutex, staticDOMDataListMutex, ());

This looks like it has race conditions.  Please add a comment about why it
isn&apos;t or consider switching to using AtomicallyInitializedStatic (from
wtf/Threading.h).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135606</commentid>
    <comment_count>3</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2009-07-29 09:31:57 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; This one too:
&gt; 
&gt; &gt; Index: WebCore/bindings/v8/DOMData.h
&gt; &gt; +WTF::Mutex&amp; DOMDataStore::allStoresMutex()
&gt; &gt; +{
&gt; &gt; +    DEFINE_STATIC_LOCAL(WTF::Mutex, staticDOMDataListMutex, ());
&gt; 
&gt; This looks like it has race conditions.  Please add a comment about why it
&gt; isn&apos;t or consider switching to using AtomicallyInitializedStatic (from
&gt; wtf/Threading.h).

Just a minor comment.  If I did measurements right, AtomicallyInitializedStatic is rather expensive on Windows, so, please, be careful to measure performance implications.  Maybe sometimes it&apos;s easier to have plain static at least for main thread.

just my 2 cents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135610</commentid>
    <comment_count>4</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-29 09:40:01 -0700</bug_when>
    <thetext>&gt;  If I did measurements right, AtomicallyInitializedStatic is rather expensive on Windows

Likely true.  I simply want something that is safe though (for anyone using the bindings in a multithreaded fashion).  Of course, there could be a (compile time or runtime) flag that indicates whether this level of safetly is needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>135627</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-07-29 10:37:58 -0700</bug_when>
    <thetext>I bet the main thread static is actually safe.  After all, you need to get a Worker wrapper before you can even create another thread.  :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1055939</commentid>
    <comment_count>6</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2014-12-16 00:48:17 -0800</bug_when>
    <thetext>Closing some V8-related work items.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>