From: Torok Edwin Date: Sun, 27 Sep 2009 11:08:03 +0000 (+0000) Subject: Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutex X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=d7830d595d43c6de4512d2ebf44a95cf4fc77ea2;ds=sidebyside Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutex in RegisterStatistic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82896 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp index 5ad569899ec..14f94bc2844 100644 --- a/lib/Support/Statistic.cpp +++ b/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);