Commit bc3dba57 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cpu-profiler] Use a non-static atomic_bool member in SamplerManager

This doesn't need to be static as the whole SamplerManager class has
only one static instance anyway, via instance().

This might also fix the weird lock behavior we are seeing on Nexus 5x
where the atomic_bool lock seems to never be released.

Bug: v8:8649
Change-Id: If44b6361c9e2a124265ca5b15b997538475a2ec9
Reviewed-on: https://chromium-review.googlesource.com/c/1414854Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58847}
parent bfc9eb2e
......@@ -287,7 +287,7 @@ class SamplerManager {
#if defined(USE_SIGNALS)
void DoSample(const v8::RegisterState& state) {
AtomicGuard atomic_guard(&SamplerManager::samplers_access_counter_, false);
AtomicGuard atomic_guard(&samplers_access_counter_, false);
if (!atomic_guard.is_success()) return;
pthread_t thread_id = pthread_self();
base::HashMap::Entry* entry =
......@@ -313,11 +313,9 @@ class SamplerManager {
private:
base::HashMap sampler_map_;
static AtomicMutex samplers_access_counter_;
AtomicMutex samplers_access_counter_;
};
AtomicMutex SamplerManager::samplers_access_counter_;
#elif V8_OS_WIN || V8_OS_CYGWIN
// ----------------------------------------------------------------------------
......
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