Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Unified Diff: src/platform-linux.cc

Issue 9455088: Remove static initializers in v8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Florian's comments. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 0da1c08fdd5cb0f63246e69e6b034acdb10348ea..a8d17cabe995e5599324bcc90cd3a1cfac761ff9 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -1090,7 +1090,7 @@ class SignalSender : public Thread {
}
static void AddActiveSampler(Sampler* sampler) {
- ScopedLock lock(mutex_);
+ ScopedLock lock(mutex_.Pointer());
SamplerRegistry::AddActiveSampler(sampler);
if (instance_ == NULL) {
// Start a thread that will send SIGPROF signal to VM threads,
@@ -1103,7 +1103,7 @@ class SignalSender : public Thread {
}
static void RemoveActiveSampler(Sampler* sampler) {
- ScopedLock lock(mutex_);
+ ScopedLock lock(mutex_.Pointer());
SamplerRegistry::RemoveActiveSampler(sampler);
if (SamplerRegistry::GetState() == SamplerRegistry::HAS_NO_SAMPLERS) {
RuntimeProfiler::StopRuntimeProfilerThreadBeforeShutdown(instance_);
@@ -1206,7 +1206,7 @@ class SignalSender : public Thread {
RuntimeProfilerRateLimiter rate_limiter_;
// Protects the process wide state below.
- static Mutex* mutex_;
+ static LazyMutex mutex_;
static SignalSender* instance_;
static bool signal_handler_installed_;
static struct sigaction old_signal_handler_;
@@ -1216,7 +1216,7 @@ class SignalSender : public Thread {
};
-Mutex* SignalSender::mutex_ = OS::CreateMutex();
+LazyMutex SignalSender::mutex_ = LAZY_MUTEX_INITIALIZER;
SignalSender* SignalSender::instance_ = NULL;
struct sigaction SignalSender::old_signal_handler_;
bool SignalSender::signal_handler_installed_ = false;
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698