From ba06f15ac89a9982a91223dbb9fbc52770a991f0 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 8 Jul 2019 22:45:59 +0000 Subject: [PATCH] [ThreadLauncher] Use mapWindowsError and LLDB_INVALID_HOST_THREAD Address post-commit feedback from Pavel and Jim. llvm-svn: 365403 --- lldb/source/Host/common/ThreadLauncher.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lldb/source/Host/common/ThreadLauncher.cpp b/lldb/source/Host/common/ThreadLauncher.cpp index 62834c5..50ab02c 100644 --- a/lldb/source/Host/common/ThreadLauncher.cpp +++ b/lldb/source/Host/common/ThreadLauncher.cpp @@ -31,10 +31,8 @@ llvm::Expected ThreadLauncher::LaunchThread( thread = (lldb::thread_t)::_beginthreadex( 0, (unsigned)min_stack_byte_size, HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL); - if (thread == (lldb::thread_t)(-1L)) { - DWORD err = GetLastError(); - return llvm::errorCodeToError(std::error_code(err, std::system_category())); - } + if (thread == LLDB_INVALID_HOST_THREAD) + return llvm::errorCodeToError(llvm::mapWindowsError(GetLastError())); #else // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames. -- 2.7.4