Revision: 24460
Author:   [email protected]
Date:     Wed Oct  8 09:34:40 2014 UTC
Log: CcTest::isolate_used_ is used from multiple threads, make it atomic

BUG=none
[email protected]
LOG=n

Review URL: https://codereview.chromium.org/637263003
https://code.google.com/p/v8/source/detail?r=24460

Modified:
 /branches/bleeding_edge/test/cctest/cctest.cc
 /branches/bleeding_edge/test/cctest/cctest.h

=======================================
--- /branches/bleeding_edge/test/cctest/cctest.cc Fri Sep 19 08:01:35 2014 UTC +++ /branches/bleeding_edge/test/cctest/cctest.cc Wed Oct 8 09:34:40 2014 UTC
@@ -47,7 +47,7 @@

 CcTest* CcTest::last_ = NULL;
 bool CcTest::initialize_called_ = false;
-bool CcTest::isolate_used_ = false;
+v8::base::Atomic32 CcTest::isolate_used_ = 0;
 v8::Isolate* CcTest::isolate_ = NULL;


=======================================
--- /branches/bleeding_edge/test/cctest/cctest.h Fri Sep 19 08:01:35 2014 UTC +++ /branches/bleeding_edge/test/cctest/cctest.h Wed Oct 8 09:34:40 2014 UTC
@@ -117,7 +117,7 @@

   static v8::Isolate* isolate() {
     CHECK(isolate_ != NULL);
-    isolate_used_ = true;
+    v8::base::NoBarrier_Store(&isolate_used_, 1);
     return isolate_;
   }

@@ -149,7 +149,7 @@
   // TODO(dcarney): Remove.
   // This must be called first in a test.
   static void InitializeVM() {
-    CHECK(!isolate_used_);
+    CHECK(!v8::base::NoBarrier_Load(&isolate_used_));
     CHECK(!initialize_called_);
     initialize_called_ = true;
     v8::HandleScope handle_scope(CcTest::isolate());
@@ -181,7 +181,7 @@
   static CcTest* last_;
   static v8::Isolate* isolate_;
   static bool initialize_called_;
-  static bool isolate_used_;
+  static v8::base::Atomic32 isolate_used_;
 };

 // Switches between all the Api tests using the threading support.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to