aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Statistic.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-09-27 11:08:03 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-09-27 11:08:03 +0000
commitd7830d595d43c6de4512d2ebf44a95cf4fc77ea2 (patch)
treedf7031c121ee8458f4eb515e83f621e8120ba008 /lib/Support/Statistic.cpp
parente298ab26b11cf6e278b4876bbc5b890e234d4029 (diff)
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
Diffstat (limited to 'lib/Support/Statistic.cpp')
-rw-r--r--lib/Support/Statistic.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp
index 5ad569899e..14f94bc284 100644
--- a/lib/Support/Statistic.cpp
+++ b/lib/Support/Statistic.cpp
@@ -57,14 +57,14 @@ public:
}
static ManagedStatic<StatisticInfo> StatInfo;
-static ManagedStatic<sys::Mutex> StatLock;
+static ManagedStatic<sys::SmartMutex<true> > 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<true> Writer(*StatLock);
if (!Initialized) {
if (Enabled)
StatInfo->addStatistic(this);