Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 5c604368920a35c5aa81feb6818219b59c697a43..342f77ccc9b261a0b397674b9ff9fd31705e1511 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -1021,7 +1021,7 @@ i::Thread::Options SourceGroup::GetThreadOptions() { |
void SourceGroup::ExecuteInThread() { |
Isolate* isolate = Isolate::New(); |
do { |
- if (next_semaphore_ != NULL) next_semaphore_->Wait(); |
+ if (!next_semaphore_.is_empty()) next_semaphore_->Wait(); |
{ |
Isolate::Scope iscope(isolate); |
Locker lock(isolate); |
@@ -1033,15 +1033,15 @@ void SourceGroup::ExecuteInThread() { |
} |
context.Dispose(); |
} |
- if (done_semaphore_ != NULL) done_semaphore_->Signal(); |
+ if (!done_semaphore_.is_empty()) done_semaphore_->Signal(); |
} while (!Shell::options.last_run); |
isolate->Dispose(); |
} |
void SourceGroup::StartExecuteInThread() { |
- if (thread_ == NULL) { |
- thread_ = new IsolateThread(this); |
+ if (thread_.is_empty()) { |
+ thread_ = i::SmartPointer<i::Thread>(new IsolateThread(this)); |
thread_->Start(); |
} |
next_semaphore_->Signal(); |
@@ -1049,10 +1049,9 @@ void SourceGroup::StartExecuteInThread() { |
void SourceGroup::WaitForThread() { |
- if (thread_ == NULL) return; |
+ if (thread_.is_empty()) return; |
if (Shell::options.last_run) { |
thread_->Join(); |
- thread_ = NULL; |
} else { |
done_semaphore_->Wait(); |
} |