diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-16 19:31:43 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-16 19:41:17 +0000 |
commit | 5161f16f4a60ef976acf4cf29dda89d9fe36e240 (patch) | |
tree | b05cad59afd8b410cfcdda93ef00dba325f0b325 | |
parent | Merge pull request #1585 (diff) | |
download | monero-5161f16f4a60ef976acf4cf29dda89d9fe36e240.tar.xz |
easylogging++: enforce recursive mutex
This fixes a hang when logging something which causes some other
logging code to be called
-rw-r--r-- | external/easylogging++/easylogging++.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index 688648452..8042392a0 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -1001,7 +1001,11 @@ namespace el { public: Mutex(void) { # if ELPP_OS_UNIX - pthread_mutex_init(&m_underlyingMutex, nullptr); + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&m_underlyingMutex, &attr); + pthread_mutexattr_destroy(&attr); # elif ELPP_OS_WINDOWS InitializeCriticalSection(&m_underlyingMutex); # endif // ELPP_OS_UNIX |