Commit 8e456031 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[arm64-simulator] Dispose stray Isolate in test

Bug: 
Change-Id: I2bebb92d2f5ed245bd7b20ee3ed1c6804605f837
Reviewed-on: https://chromium-review.googlesource.com/704644
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48343}
parent 88e74d35
......@@ -275,30 +275,33 @@ class MemoryAccessThread : public v8::base::Thread {
test_data_(NULL),
is_finished_(false),
has_request_(false),
did_request_(false) {}
did_request_(false),
isolate_(nullptr) {}
virtual void Run() {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
v8::Isolate::Scope scope(isolate);
v8::base::LockGuard<v8::base::Mutex> lock_guard(&mutex_);
while (!is_finished_) {
while (!(has_request_ || is_finished_)) {
has_request_cv_.Wait(&mutex_);
}
isolate_ = v8::Isolate::New(create_params);
Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate_);
{
v8::Isolate::Scope scope(isolate_);
v8::base::LockGuard<v8::base::Mutex> lock_guard(&mutex_);
while (!is_finished_) {
while (!(has_request_ || is_finished_)) {
has_request_cv_.Wait(&mutex_);
}
if (is_finished_) {
break;
}
if (is_finished_) {
break;
ExecuteMemoryAccess(i_isolate, test_data_, access_);
has_request_ = false;
did_request_ = true;
did_request_cv_.NotifyOne();
}
ExecuteMemoryAccess(i_isolate, test_data_, access_);
has_request_ = false;
did_request_ = true;
did_request_cv_.NotifyOne();
}
isolate_->Dispose();
}
void NextAndWait(TestData* test_data, MemoryAccess access) {
......@@ -329,6 +332,7 @@ class MemoryAccessThread : public v8::base::Thread {
v8::base::Mutex mutex_;
v8::base::ConditionVariable has_request_cv_;
v8::base::ConditionVariable did_request_cv_;
v8::Isolate* isolate_;
};
TEST(simulator_invalidate_exclusive_access_threaded) {
......
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