Fixes threading annotations and compatibility with C++11, which doesn't

allow exepctions to be thrown in a destructor.
This commit is contained in:
zhanyong.wan
2012-05-31 20:37:13 +00:00
parent cdb24f86d5
commit a3b859162d
3 changed files with 16 additions and 10 deletions

View File

@@ -3530,7 +3530,7 @@ void StreamingListener::MakeConnection() {
// Pushes the given source file location and message onto a per-thread
// trace stack maintained by Google Test.
ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)
GTEST_LOCK_EXCLUDED_(UnitTest::mutex_) {
GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
TraceInfo trace;
trace.file = file;
trace.line = line;
@@ -3541,7 +3541,7 @@ ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)
// Pops the info pushed by the c'tor.
ScopedTrace::~ScopedTrace()
GTEST_LOCK_EXCLUDED_(UnitTest::mutex_) {
GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
UnitTest::GetInstance()->PopGTestTrace();
}