diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2016-03-03 22:45:19 -0800 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2016-03-03 22:45:19 -0800 |
commit | a55c8f370bd663ea1d31fed230987711aa1cf176 (patch) | |
tree | 567a995e2f0565d24aebff0fab959d3c95045670 /src/async/pop | |
parent | 886aae2ab94c74a4d4c644c446f67d37a333c1f9 (diff) |
Thread safety on logger
Diffstat (limited to 'src/async/pop')
-rw-r--r-- | src/async/pop/MCPOPAsyncSession.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/async/pop/MCPOPAsyncSession.cpp b/src/async/pop/MCPOPAsyncSession.cpp index dead660f..f1897b84 100644 --- a/src/async/pop/MCPOPAsyncSession.cpp +++ b/src/async/pop/MCPOPAsyncSession.cpp @@ -240,13 +240,13 @@ void POPAsyncSession::setConnectionLogger(ConnectionLogger * logger) { pthread_mutex_lock(&mConnectionLoggerLock); mConnectionLogger = logger; - if (mConnectionLogger != NULL) { + pthread_mutex_unlock(&mConnectionLoggerLock); + if (logger != NULL) { mSession->setConnectionLogger(mInternalLogger); } else { mSession->setConnectionLogger(NULL); } - pthread_mutex_unlock(&mConnectionLoggerLock); } ConnectionLogger * POPAsyncSession::connectionLogger() |