summaryrefslogtreecommitdiffstats
path: root/src/testlib/qplaintestlogger.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-08-28 09:22:06 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-30 06:22:45 +0200
commitf7de5b09234e7dd735d91a7b332d841ca6c6fe53 (patch)
treea94396da220e59228c2632538d8d22285d5177fc /src/testlib/qplaintestlogger.cpp
parent7cea395d1f4b1e875cc14930e56a6ea2dea0c9a7 (diff)
Logging: Remove mutex for OutputDebugString
OutputDebugString seems indeed to be thread safe, at least according to http://www.unixwiz.net/techtips/outputdebugstring.html . I also didn't manage to run into any deadlocks on Windows 7 ... The comment + code was already there (in qcoreapplication_win.cpp) in the first git commit that imported Qt. Change-Id: I442e22575558958ef21ab8c6b4cc8b03aee906b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qplaintestlogger.cpp')
-rw-r--r--src/testlib/qplaintestlogger.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index 5a451b331d..e4c636cfce 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -66,10 +66,6 @@ QT_BEGIN_NAMESPACE
namespace QTest {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- static CRITICAL_SECTION outputCriticalSection;
-#endif
-
static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type)
{
switch (type) {
@@ -209,10 +205,7 @@ void QPlainTestLogger::outputMessage(const char *str)
} while (!strUtf16.isEmpty());
if (stream != stdout)
#elif defined(Q_OS_WIN)
- EnterCriticalSection(&QTest::outputCriticalSection);
- // OutputDebugString is not threadsafe
OutputDebugStringA(str);
- LeaveCriticalSection(&QTest::outputCriticalSection);
#endif
outputString(str);
}
@@ -310,16 +303,10 @@ void QPlainTestLogger::printBenchmarkResult(const QBenchmarkResult &result)
QPlainTestLogger::QPlainTestLogger(const char *filename)
: QAbstractTestLogger(filename)
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- InitializeCriticalSection(&QTest::outputCriticalSection);
-#endif
}
QPlainTestLogger::~QPlainTestLogger()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- DeleteCriticalSection(&QTest::outputCriticalSection);
-#endif
}
void QPlainTestLogger::startLogging()