Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 21d64df21c7abb426964b2f50377143f705a6120..e023d8864420d9d1aeb872958cdbf28245b513a3 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -35,7 +35,6 @@ |
#include "global-handles.h" |
#include "log.h" |
#include "macro-assembler.h" |
-#include "platform.h" |
#include "runtime-profiler.h" |
#include "serialize.h" |
#include "string-stream.h" |
@@ -1729,14 +1728,13 @@ void Logger::EnableSlidingStateWindow() { |
} |
} |
-// Protects the state below. |
-static LazyMutex active_samplers_mutex = LAZY_MUTEX_INITIALIZER; |
+Mutex* SamplerRegistry::mutex_ = OS::CreateMutex(); |
List<Sampler*>* SamplerRegistry::active_samplers_ = NULL; |
bool SamplerRegistry::IterateActiveSamplers(VisitSampler func, void* param) { |
- ScopedLock lock(active_samplers_mutex.Pointer()); |
+ ScopedLock lock(mutex_); |
for (int i = 0; |
ActiveSamplersExist() && i < active_samplers_->length(); |
++i) { |
@@ -1763,7 +1761,7 @@ SamplerRegistry::State SamplerRegistry::GetState() { |
void SamplerRegistry::AddActiveSampler(Sampler* sampler) { |
ASSERT(sampler->IsActive()); |
- ScopedLock lock(active_samplers_mutex.Pointer()); |
+ ScopedLock lock(mutex_); |
if (active_samplers_ == NULL) { |
active_samplers_ = new List<Sampler*>; |
} else { |
@@ -1775,7 +1773,7 @@ void SamplerRegistry::AddActiveSampler(Sampler* sampler) { |
void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
ASSERT(sampler->IsActive()); |
- ScopedLock lock(active_samplers_mutex.Pointer()); |
+ ScopedLock lock(mutex_); |
ASSERT(active_samplers_ != NULL); |
bool removed = active_samplers_->RemoveElement(sampler); |
ASSERT(removed); |