From 54512bd6c9bed0a7ed0e0d6d957442dd4c40fee3 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 3 Sep 2010 19:15:43 +0000 Subject: Fixed a case where we might be able to acquire a mutex with a try lock and not release it by making sure a mutex locker object is appropriately used. llvm-svn: 112996 --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index aa3cf6b0308..815ceceb036 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1117,7 +1117,8 @@ ProcessGDBRemote::DoHalt () if (m_gdb_comm.IsRunning()) { bool timed_out = false; - if (!m_gdb_comm.SendInterrupt (2, &timed_out)) + Mutex::Locker locker; + if (!m_gdb_comm.SendInterrupt (locker, 2, &timed_out)) { if (timed_out) error.SetErrorString("timed out sending interrupt packet"); @@ -1150,7 +1151,8 @@ ProcessGDBRemote::DoDestroy () log->Printf ("ProcessGDBRemote::DoDestroy()"); // Interrupt if our inferior is running... - m_gdb_comm.SendInterrupt (1); + Mutex::Locker locker; + m_gdb_comm.SendInterrupt (locker, 1); DisableAllBreakpointSites (); SetExitStatus(-1, "process killed"); -- cgit v1.2.3