From 744322c2475735fe2abbdfd2b28f5a25612d5822 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 31 Dec 2020 20:58:30 -0700 Subject: [PATCH] HackStudio: Call Thread::join instead of pthread_join It's really awkward that HackStudioWidget was calling the pthread API on its LibThread::Thread. Change to calling the new Thread::join call, which returns the information it wants to log. --- DevTools/HackStudio/HackStudioWidget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index f1ca53cf9a..db926ef799 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -920,11 +920,10 @@ HackStudioWidget::~HackStudioWidget() { if (!m_debugger_thread.is_null()) { Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::Exit); - void* retval; dbgln("Waiting for debugger thread to terminate"); - int rc = pthread_join(m_debugger_thread->tid(), &retval); - if (rc < 0) { - perror("pthread_join"); + auto rc = m_debugger_thread->join(); + if (rc.is_error()) { + warnln("pthread_join: {}", strerror(rc.error().value())); dbgln("error joining debugger thread"); } }