Commit 92523a45 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Join threads after stopping.

R=hpayer@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent aadcf381
...@@ -73,6 +73,7 @@ void MarkingThread::Stop() { ...@@ -73,6 +73,7 @@ void MarkingThread::Stop() {
Release_Store(&stop_thread_, static_cast<AtomicWord>(true)); Release_Store(&stop_thread_, static_cast<AtomicWord>(true));
start_marking_semaphore_->Signal(); start_marking_semaphore_->Signal();
stop_semaphore_->Wait(); stop_semaphore_->Wait();
Join();
} }
......
...@@ -130,6 +130,8 @@ void OptimizingCompilerThread::Stop() { ...@@ -130,6 +130,8 @@ void OptimizingCompilerThread::Stop() {
double percentage = (compile_time * 100) / total_time; double percentage = (compile_time * 100) / total_time;
PrintF(" ** Compiler thread did %.2f%% useful work\n", percentage); PrintF(" ** Compiler thread did %.2f%% useful work\n", percentage);
} }
Join();
} }
......
...@@ -93,6 +93,7 @@ void SweeperThread::Stop() { ...@@ -93,6 +93,7 @@ void SweeperThread::Stop() {
Release_Store(&stop_thread_, static_cast<AtomicWord>(true)); Release_Store(&stop_thread_, static_cast<AtomicWord>(true));
start_sweeping_semaphore_->Signal(); start_sweeping_semaphore_->Signal();
stop_semaphore_->Wait(); stop_semaphore_->Wait();
Join();
} }
......
...@@ -566,4 +566,25 @@ TEST(BootUpMemoryUse) { ...@@ -566,4 +566,25 @@ TEST(BootUpMemoryUse) {
} }
} }
intptr_t ShortLivingIsolate() {
v8::Isolate* isolate = v8::Isolate::New();
{ v8::Isolate::Scope isolate_scope(isolate);
v8::Locker lock(isolate);
v8::HandleScope handle_scope;
v8::Local<v8::Context> context = v8::Context::New(isolate);
CHECK(!context.IsEmpty());
}
isolate->Dispose();
return MemoryInUse();
}
TEST(RegressJoinThreadsOnIsolateDeinit) {
intptr_t first_size = ShortLivingIsolate();
for (int i = 0; i < 10; i++) {
CHECK_EQ(first_size, ShortLivingIsolate());
}
}
#endif // __linux__ and !USE_SIMULATOR #endif // __linux__ and !USE_SIMULATOR
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