| Index: src/runtime-profiler.cc
|
| diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
|
| index cde6057ac406a4b428ef77464f953463f3d82601..fc7e3591c4f91c8bfa60688cfa984087e66f8996 100644
|
| --- a/src/runtime-profiler.cc
|
| +++ b/src/runtime-profiler.cc
|
| @@ -72,9 +72,9 @@ static const int kMaxSizeEarlyOpt = 500;
|
|
|
|
|
| Atomic32 RuntimeProfiler::state_ = 0;
|
| -
|
| -// TODO(isolates): Clean up the semaphore when it is no longer required.
|
| -static LazySemaphore<0>::type semaphore = LAZY_SEMAPHORE_INITIALIZER;
|
| +// TODO(isolates): Create the semaphore lazily and clean it up when no
|
| +// longer required.
|
| +Semaphore* RuntimeProfiler::semaphore_ = OS::CreateSemaphore(0);
|
|
|
| #ifdef DEBUG
|
| bool RuntimeProfiler::has_been_globally_set_up_ = false;
|
| @@ -412,7 +412,7 @@ void RuntimeProfiler::HandleWakeUp(Isolate* isolate) {
|
| // undid the decrement done by the profiler thread. Increment again
|
| // to get the right count of active isolates.
|
| NoBarrier_AtomicIncrement(&state_, 1);
|
| - semaphore.Pointer()->Signal();
|
| + semaphore_->Signal();
|
| }
|
|
|
|
|
| @@ -425,7 +425,7 @@ bool RuntimeProfiler::WaitForSomeIsolateToEnterJS() {
|
| Atomic32 old_state = NoBarrier_CompareAndSwap(&state_, 0, -1);
|
| ASSERT(old_state >= -1);
|
| if (old_state != 0) return false;
|
| - semaphore.Pointer()->Wait();
|
| + semaphore_->Wait();
|
| return true;
|
| }
|
|
|
| @@ -441,7 +441,7 @@ void RuntimeProfiler::StopRuntimeProfilerThreadBeforeShutdown(Thread* thread) {
|
| if (new_state == 0) {
|
| // The profiler thread is waiting. Wake it up. It must check for
|
| // stop conditions before attempting to wait again.
|
| - semaphore.Pointer()->Signal();
|
| + semaphore_->Signal();
|
| }
|
| thread->Join();
|
| // The profiler thread is now stopped. Undo the increment in case it
|
|
|