Skip to content

[debugserver] Remove PThreadMutex (NFC) #137555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
26CE05BA115C363E0022F371 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
26CE05BB115C363F0022F371 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
26CE05BC115C36420022F371 /* PThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FE0C71334A0024798E /* PThreadEvent.cpp */; };
26CE05BD115C36430022F371 /* PThreadMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */; };
26CE05BE115C36440022F371 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
26CE05BF115C364D0022F371 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
26CE05C3115C36580022F371 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
Expand Down Expand Up @@ -65,7 +64,6 @@
456F67591AD46CE9002850C2 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
456F675A1AD46CE9002850C2 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
456F675B1AD46CE9002850C2 /* PThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FE0C71334A0024798E /* PThreadEvent.cpp */; };
456F675C1AD46CE9002850C2 /* PThreadMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */; };
456F675D1AD46CE9002850C2 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
456F675E1AD46CE9002850C2 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
456F67621AD46CE9002850C2 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
Expand Down Expand Up @@ -102,7 +100,6 @@
26593A060D4931CC001C9FE3 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };
266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplARM64.cpp; sourceTree = "<group>"; };
266B5ED01460A68200E43F0A /* DNBArchImplARM64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplARM64.h; sourceTree = "<group>"; };
2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PThreadMutex.cpp; sourceTree = "<group>"; };
2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFBundle.cpp; sourceTree = "<group>"; };
2695DD920D3EBFF6007E4CA2 /* CFBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBundle.h; sourceTree = "<group>"; };
2695DD9A0D3EC160007E4CA2 /* CFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFString.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,7 +148,6 @@
26C637FD0C71334A0024798E /* PThreadCondition.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadCondition.h; sourceTree = "<group>"; };
26C637FE0C71334A0024798E /* PThreadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PThreadEvent.cpp; sourceTree = "<group>"; };
26C637FF0C71334A0024798E /* PThreadEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadEvent.h; sourceTree = "<group>"; };
26C638000C71334A0024798E /* PThreadMutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadMutex.h; sourceTree = "<group>"; };
26C638010C71334A0024798E /* SysSignal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SysSignal.cpp; sourceTree = "<group>"; };
26C638020C71334A0024798E /* SysSignal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SysSignal.h; sourceTree = "<group>"; };
26C638050C71334A0024798E /* TTYState.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TTYState.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -284,8 +280,6 @@
26C637FD0C71334A0024798E /* PThreadCondition.h */,
26C637FF0C71334A0024798E /* PThreadEvent.h */,
26C637FE0C71334A0024798E /* PThreadEvent.cpp */,
26C638000C71334A0024798E /* PThreadMutex.h */,
2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */,
233B4EA81D2DB96A00E98261 /* StringConvert.cpp */,
26C638020C71334A0024798E /* SysSignal.h */,
26C638010C71334A0024798E /* SysSignal.cpp */,
Expand Down Expand Up @@ -486,7 +480,6 @@
26CE05BA115C363E0022F371 /* DNBLog.cpp in Sources */,
26CE05BB115C363F0022F371 /* DNBRegisterInfo.cpp in Sources */,
26CE05BC115C36420022F371 /* PThreadEvent.cpp in Sources */,
26CE05BD115C36430022F371 /* PThreadMutex.cpp in Sources */,
26CE05BE115C36440022F371 /* SysSignal.cpp in Sources */,
26CE05BF115C364D0022F371 /* DNBArchImplX86_64.cpp in Sources */,
26CE05C5115C36590022F371 /* CFBundle.cpp in Sources */,
Expand Down Expand Up @@ -525,7 +518,6 @@
456F67591AD46CE9002850C2 /* DNBLog.cpp in Sources */,
456F675A1AD46CE9002850C2 /* DNBRegisterInfo.cpp in Sources */,
456F675B1AD46CE9002850C2 /* PThreadEvent.cpp in Sources */,
456F675C1AD46CE9002850C2 /* PThreadMutex.cpp in Sources */,
456F675D1AD46CE9002850C2 /* SysSignal.cpp in Sources */,
456F675E1AD46CE9002850C2 /* DNBArchImplX86_64.cpp in Sources */,
23043C9E1D35DBFA00FC25CA /* StringConvert.cpp in Sources */,
Expand Down
1 change: 0 additions & 1 deletion lldb/tools/debugserver/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ set(lldbDebugserverCommonSources
libdebugserver.cpp
PseudoTerminal.cpp
PThreadEvent.cpp
PThreadMutex.cpp
RNBContext.cpp
RNBRemote.cpp
RNBServices.cpp
Expand Down
5 changes: 3 additions & 2 deletions lldb/tools/debugserver/source/DNB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cstdlib>
#include <libproc.h>
#include <map>
#include <mutex>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
Expand Down Expand Up @@ -69,8 +70,8 @@ static ProcessMap *GetProcessMap(bool can_create) {
static ProcessMap *g_process_map_ptr = NULL;

if (can_create && g_process_map_ptr == NULL) {
static pthread_mutex_t g_process_map_mutex = PTHREAD_MUTEX_INITIALIZER;
PTHREAD_MUTEX_LOCKER(locker, &g_process_map_mutex);
static std::mutex g_process_map_mutex;
std::lock_guard<std::mutex> guard(g_process_map_mutex);
if (g_process_map_ptr == NULL)
g_process_map_ptr = new ProcessMap;
}
Expand Down
1 change: 0 additions & 1 deletion lldb/tools/debugserver/source/DNBError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "DNBError.h"
#include "CFString.h"
#include "DNBLog.h"
#include "PThreadMutex.h"

#ifdef WITH_SPRINGBOARD
#include <SpringBoardServices/SpringBoardServer.h>
Expand Down
1 change: 0 additions & 1 deletion lldb/tools/debugserver/source/DNBTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBTIMER_H

#include "DNBDefs.h"
#include "PThreadMutex.h"
#include <cstdint>
#include <mutex>
#include <sys/time.h>
Expand Down
1 change: 0 additions & 1 deletion lldb/tools/debugserver/source/MacOSX/MachException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "DNBError.h"
#include "DNBLog.h"
#include "MachProcess.h"
#include "PThreadMutex.h"
#include "SysSignal.h"
#include <cerrno>
#include <inttypes.h>
Expand Down
1 change: 0 additions & 1 deletion lldb/tools/debugserver/source/MacOSX/MachException.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <vector>

class MachProcess;
class PThreadMutex;

typedef union MachMessageTag {
mach_msg_header_t hdr;
Expand Down
11 changes: 5 additions & 6 deletions lldb/tools/debugserver/source/MacOSX/MachTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
#ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_MACHTASK_H
#define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_MACHTASK_H

#include <mach/mach.h>
#include <sys/socket.h>
#include <map>
#include <string>
#include "DNBDefs.h"
#include "RNBContext.h"
#include "MachException.h"
#include "MachVMMemory.h"
#include "PThreadMutex.h"
#include "RNBContext.h"
#include <mach/mach.h>
#include <map>
#include <string>
#include <sys/socket.h>

class MachProcess;

Expand Down
66 changes: 0 additions & 66 deletions lldb/tools/debugserver/source/PThreadMutex.cpp

This file was deleted.

119 changes: 0 additions & 119 deletions lldb/tools/debugserver/source/PThreadMutex.h

This file was deleted.

Loading