Skip to content

Commit 0755e02

Browse files
authored
[debugserver] Migrate DNBLog away from PThreadMutex (NFC) (llvm#137541)
The debugserver code predates modern C++, but with C++11 and later there's no need to have something like PThreadMutex. This migrates DNBLog away from that class in preparation for removing PThreadMutex.
1 parent ae71055 commit 0755e02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/tools/debugserver/source/DNBLog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ static int g_verbose = 0;
1717

1818
#if defined(DNBLOG_ENABLED)
1919

20-
#include "PThreadMutex.h"
2120
#include <cstdarg>
2221
#include <cstdio>
2322
#include <cstdlib>
@@ -64,8 +63,8 @@ bool DNBLogEnabledForAny(uint32_t mask) {
6463
}
6564
static inline void _DNBLogVAPrintf(uint32_t flags, const char *format,
6665
va_list args) {
67-
static PThreadMutex g_LogThreadedMutex(PTHREAD_MUTEX_RECURSIVE);
68-
PTHREAD_MUTEX_LOCKER(locker, g_LogThreadedMutex);
66+
static std::recursive_mutex g_LogThreadedMutex;
67+
std::lock_guard<std::recursive_mutex> guard(g_LogThreadedMutex);
6968

7069
if (g_log_callback)
7170
g_log_callback(g_log_baton, flags, format, args);

0 commit comments

Comments
 (0)