From 819d15c7d97a0488e6851d5631690ad2588ec6e2 Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Sun, 27 Sep 2009 11:08:03 +0000 Subject: Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutex in RegisterStatistic. llvm-svn: 82896 --- llvm/lib/Support/Statistic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/Statistic.cpp') diff --git a/llvm/lib/Support/Statistic.cpp b/llvm/lib/Support/Statistic.cpp index 5ad569899ec..14f94bc2844 100644 --- a/llvm/lib/Support/Statistic.cpp +++ b/llvm/lib/Support/Statistic.cpp @@ -57,14 +57,14 @@ public: } static ManagedStatic StatInfo; -static ManagedStatic StatLock; +static ManagedStatic > StatLock; /// RegisterStatistic - The first time a statistic is bumped, this method is /// called. void Statistic::RegisterStatistic() { // If stats are enabled, inform StatInfo that this statistic should be // printed. - sys::ScopedLock Writer(*StatLock); + sys::SmartScopedLock Writer(*StatLock); if (!Initialized) { if (Enabled) StatInfo->addStatistic(this); -- cgit v1.2.3