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