diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-23 14:50:01 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-23 14:50:01 +0000 |
| commit | 0408e1d309a743aca4ed4592cf2c712a71537901 (patch) | |
| tree | 6be075b410677415707e0987e3a49123130cef22 /lib/Support/Statistic.cpp | |
| parent | b2f21fb044b6b5c52cff6227f9f79ca4ed42b18f (diff) | |
Notes
Diffstat (limited to 'lib/Support/Statistic.cpp')
| -rw-r--r-- | lib/Support/Statistic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp index 13acc1b0fa1e5..6c652f8d3f162 100644 --- a/lib/Support/Statistic.cpp +++ b/lib/Support/Statistic.cpp @@ -25,6 +25,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Streams.h" +#include "llvm/System/Mutex.h" #include "llvm/ADT/StringExtras.h" #include <algorithm> #include <ostream> @@ -57,13 +58,14 @@ public: } static ManagedStatic<StatisticInfo> StatInfo; - +static ManagedStatic<sys::Mutex> 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); if (Enabled) StatInfo->addStatistic(this); // Remember we have been registered. |
