summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-12-08 01:09:39 +0000
committerVedant Kumar <vsk@apple.com>2017-12-08 01:09:39 +0000
commitb773e488c980bde0cb45ae061bf8c9a1058f897c (patch)
tree76b10db0a5b432f671b3a05e565b144d7b299530 /lldb/tools/debugserver/source/MacOSX
parent0fb6faa0becbf5e4dadb1656f0d7aea286e1ad37 (diff)
downloadbcm5719-llvm-b773e488c980bde0cb45ae061bf8c9a1058f897c.tar.gz
bcm5719-llvm-b773e488c980bde0cb45ae061bf8c9a1058f897c.zip
Remove extant references to g_message_mutex, NFC
Thanks to Jim Ingham for providing the explanation! llvm-svn: 320126
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachException.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachException.cpp b/lldb/tools/debugserver/source/MacOSX/MachException.cpp
index 5f085867db2..12479b8b7e8 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachException.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachException.cpp
@@ -47,13 +47,13 @@ extern "C" kern_return_t catch_mach_exception_raise_state_identity(
extern "C" boolean_t mach_exc_server(mach_msg_header_t *InHeadP,
mach_msg_header_t *OutHeadP);
-// Any access to the g_message variable should be done by locking the
-// g_message_mutex first, using the g_message variable, then unlocking
-// the g_message_mutex. See MachException::Message::CatchExceptionRaise()
-// for sample code.
-
+// Note: g_message points to the storage allocated to catch the data from
+// catching the current exception raise. It's populated when we catch a raised
+// exception which can't immediately be replied to.
+//
+// If it becomes possible to catch exceptions from multiple threads
+// simultaneously, accesses to g_message would need to be mutually exclusive.
static MachException::Data *g_message = NULL;
-// static pthread_mutex_t g_message_mutex = PTHREAD_MUTEX_INITIALIZER;
extern "C" kern_return_t catch_mach_exception_raise_state(
mach_port_t exc_port, exception_type_t exc_type,
@@ -272,9 +272,6 @@ kern_return_t MachException::Message::Receive(mach_port_t port,
bool MachException::Message::CatchExceptionRaise(task_t task) {
bool success = false;
- // locker will keep a mutex locked until it goes out of scope
- // PThreadMutex::Locker locker(&g_message_mutex);
- // DNBLogThreaded("calling mach_exc_server");
state.task_port = task;
g_message = &state;
// The exc_server function is the MIG generated server handling function
OpenPOWER on IntegriCloud