diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r-- | lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp | 9 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp index cfcd7f9fe2d..f2e906e0ae2 100644 --- a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp +++ b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp @@ -1167,7 +1167,7 @@ ProcessMacOSX::Clear() m_exception_messages.clear(); } - if (m_monitor_thread != LLDB_INVALID_HOST_THREAD) + if (IS_VALID_LLDB_HOST_THREAD(m_monitor_thread)) { Host::ThreadCancel (m_monitor_thread, NULL); thread_result_t thread_result; @@ -1180,6 +1180,9 @@ ProcessMacOSX::Clear() bool ProcessMacOSX::StartSTDIOThread() { + if (IS_VALID_LLDB_HOST_THREAD(m_stdio_thread)) + return true; + // If we created and own the child STDIO file handles, then we track the // STDIO ourselves, else we let whomever owns these file handles track // the IO themselves. @@ -1188,7 +1191,7 @@ ProcessMacOSX::StartSTDIOThread() ProcessMacOSXLog::LogIf (PD_LOG_PROCESS, "ProcessMacOSX::%s ( )", __FUNCTION__); // Create the thread that watches for the child STDIO m_stdio_thread = Host::ThreadCreate ("<lldb.process.process-macosx.stdio>", ProcessMacOSX::STDIOThread, this, NULL); - return m_stdio_thread != LLDB_INVALID_HOST_THREAD; + return IS_VALID_LLDB_HOST_THREAD(m_stdio_thread); } return false; } @@ -1199,7 +1202,7 @@ ProcessMacOSX::StopSTDIOThread(bool close_child_fds) { ProcessMacOSXLog::LogIf (PD_LOG_PROCESS, "ProcessMacOSX::%s ( )", __FUNCTION__); // Stop the stdio thread - if (m_stdio_thread != LLDB_INVALID_HOST_THREAD) + if (IS_VALID_LLDB_HOST_THREAD(m_stdio_thread)) { Host::ThreadCancel (m_stdio_thread, NULL); thread_result_t result = NULL; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 41296d9733f..50fa2005e17 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -131,7 +131,7 @@ ProcessGDBRemote::~ProcessGDBRemote() { m_dynamic_loader_ap.reset(); - if (m_debugserver_thread != LLDB_INVALID_HOST_THREAD) + if (IS_VALID_LLDB_HOST_THREAD(m_debugserver_thread)) { Host::ThreadCancel (m_debugserver_thread, NULL); thread_result_t thread_result; @@ -2174,7 +2174,7 @@ ProcessGDBRemote::StartAsyncThread () // Create a thread that watches our internal state and controls which // events make it to clients (into the DCProcess event queue). m_async_thread = Host::ThreadCreate ("<lldb.process.gdb-remote.async>", ProcessGDBRemote::AsyncThread, this, NULL); - return m_async_thread != LLDB_INVALID_HOST_THREAD; + return IS_VALID_LLDB_HOST_THREAD(m_async_thread); } void @@ -2188,7 +2188,7 @@ ProcessGDBRemote::StopAsyncThread () m_async_broadcaster.BroadcastEvent (eBroadcastBitAsyncThreadShouldExit); // Stop the stdio thread - if (m_async_thread != LLDB_INVALID_HOST_THREAD) + if (IS_VALID_LLDB_HOST_THREAD(m_async_thread)) { Host::ThreadJoin (m_async_thread, NULL, NULL); } |