Commit e1fe5da3 authored by jochen@chromium.org's avatar jochen@chromium.org

CcTest::isolate_used_ is used from multiple threads, make it atomic

BUG=none
R=svenpanne@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/637263003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24460 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 42365d42
......@@ -47,7 +47,7 @@ static bool disable_automatic_dispose_ = false;
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;
......
......@@ -117,7 +117,7 @@ class CcTest {
static v8::Isolate* isolate() {
CHECK(isolate_ != NULL);
isolate_used_ = true;
v8::base::NoBarrier_Store(&isolate_used_, 1);
return isolate_;
}
......@@ -149,7 +149,7 @@ class CcTest {
// 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 @@ class CcTest {
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment