diff options
Diffstat (limited to 'CommonLibs/Logger.cpp')
-rw-r--r-- | CommonLibs/Logger.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index 5db7f87..89e13e5 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -48,9 +48,11 @@ Log::~Log() int neednl = (mlen==0 || mStream.str()[mlen-1] != '\n'); const char *fmt = neednl ? "%s\n" : "%s"; - log_mutex_lock_canceldisable(&old_state); + /* print related function called inside a C++ destructor, use pthread_setcancelstate() APIs. + See osmo-trx commit 86be40b4eb762d5c12e8e3f7388ca9f254e77b36 for more information */ + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_state); LOGPSRC(mCategory, mPriority, filename, line, fmt, mStream.str().c_str()); - log_mutex_unlock_canceldisable(old_state); + pthread_setcancelstate(old_state, NULL); } ostringstream& Log::get() |