Fix potential deadlock in webrtc/system_wrappers/source/logging_unittest.cc.
crit_ should not be held while calling Trace.
BUG=3003
R=henrike@webrtc.org, pbos@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/17859005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6616 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/system_wrappers/source/logging_unittest.cc b/webrtc/system_wrappers/source/logging_unittest.cc
index 19f1394..d1eab32 100644
--- a/webrtc/system_wrappers/source/logging_unittest.cc
+++ b/webrtc/system_wrappers/source/logging_unittest.cc
@@ -51,17 +51,16 @@
}
void TearDown() {
- CriticalSectionScoped cs(crit_.get());
Trace::SetTraceCallback(NULL);
Trace::ReturnTrace();
+ CriticalSectionScoped cs(crit_.get());
ASSERT_EQ(kTraceNone, level_) << "Print() was not called";
}
scoped_ptr<CriticalSectionWrapper> crit_;
scoped_ptr<ConditionVariableWrapper> cv_;
- TraceLevel level_;
- int length_;
- std::ostringstream expected_log_;
+ TraceLevel level_ GUARDED_BY(crit_);
+ std::ostringstream expected_log_ GUARDED_BY(crit_);
};
TEST_F(LoggingTest, LogStream) {