1 //===-- ThreadLauncher.h ----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef lldb_Host_ThreadLauncher_h_
10 #define lldb_Host_ThreadLauncher_h_
12 #include "lldb/Host/HostThread.h"
13 #include "lldb/lldb-types.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/Error.h"
18 namespace lldb_private {
20 class ThreadLauncher {
22 static llvm::Expected<HostThread>
23 LaunchThread(llvm::StringRef name, lldb::thread_func_t thread_function,
24 lldb::thread_arg_t thread_arg,
25 size_t min_stack_byte_size = 0); // Minimum stack size in bytes,
26 // set stack size to zero for
27 // default platform thread stack
30 struct HostThreadCreateInfo {
31 std::string thread_name;
32 lldb::thread_func_t thread_fptr;
33 lldb::thread_arg_t thread_arg;
35 HostThreadCreateInfo(const char *name, lldb::thread_func_t fptr,
36 lldb::thread_arg_t arg)
37 : thread_name(name ? name : ""), thread_fptr(fptr), thread_arg(arg) {}