summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit819d15c7d97a0488e6851d5631690ad2588ec6e2 (patch)
tree40190c96c5b155d5100c270884201c8e1ee584be /llvm/lib/Support/Statistic.cpp
parent67f09df0dbffb0284d1ab5c53066e6889fb83559 (diff)
downloadbcm5719-llvm-819d15c7d97a0488e6851d5631690ad2588ec6e2.tar.gz
bcm5719-llvm-819d15c7d97a0488e6851d5631690ad2588ec6e2.zip
Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutex
in RegisterStatistic. llvm-svn: 82896
Diffstat (limited to 'llvm/lib/Support/Statistic.cpp')
-rw-r--r--llvm/lib/Support/Statistic.cpp4
1 files changed, 2 insertions, 2 deletions
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<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);
OpenPOWER on IntegriCloud