xref: /NextBSD/contrib/llvm/tools/lldb/include/lldb/Host/ThreadLauncher.h (revision 287e3b14e9552995def1802ec9c5034f4adf28ec)
1 //===-- ThreadLauncher.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef lldb_Host_ThreadLauncher_h_
11 #define lldb_Host_ThreadLauncher_h_
12 
13 #include "lldb/Core/Error.h"
14 #include "lldb/Host/HostThread.h"
15 #include "lldb/lldb-types.h"
16 
17 #include "llvm/ADT/StringRef.h"
18 
19 namespace lldb_private
20 {
21 
22 class ThreadLauncher
23 {
24   public:
25     static HostThread LaunchThread(llvm::StringRef name,
26                                    lldb::thread_func_t thread_function,
27                                    lldb::thread_arg_t thread_arg,
28                                    Error *error_ptr,
29                                    size_t min_stack_byte_size = 0); // Minimum stack size in bytes, set stack size to zero for default platform thread stack size
30 
31     struct HostThreadCreateInfo
32     {
33         std::string thread_name;
34         lldb::thread_func_t thread_fptr;
35         lldb::thread_arg_t thread_arg;
36 
HostThreadCreateInfoHostThreadCreateInfo37         HostThreadCreateInfo(const char *name, lldb::thread_func_t fptr, lldb::thread_arg_t arg)
38             : thread_name(name ? name : "")
39             , thread_fptr(fptr)
40             , thread_arg(arg)
41         {
42         }
43     };
44 };
45 }
46 
47 #endif
48