Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:49

0001 //===-- ThreadLauncher.h ----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_THREADLAUNCHER_H
0010 #define LLDB_HOST_THREADLAUNCHER_H
0011 
0012 #include "lldb/Host/HostThread.h"
0013 #include "lldb/lldb-types.h"
0014 
0015 #include "llvm/ADT/StringRef.h"
0016 #include "llvm/Support/Error.h"
0017 
0018 namespace lldb_private {
0019 
0020 class ThreadLauncher {
0021 public:
0022   static llvm::Expected<HostThread>
0023   LaunchThread(llvm::StringRef name,
0024                std::function<lldb::thread_result_t()> thread_function,
0025                size_t min_stack_byte_size = 0); // Minimum stack size in bytes,
0026                                                 // set stack size to zero for
0027                                                 // default platform thread stack
0028                                                 // size
0029 
0030   struct HostThreadCreateInfo {
0031     std::string thread_name;
0032     std::function<lldb::thread_result_t()> impl;
0033 
0034     HostThreadCreateInfo(std::string thread_name,
0035                          std::function<lldb::thread_result_t()> impl)
0036         : thread_name(std::move(thread_name)), impl(std::move(impl)) {}
0037   };
0038 };
0039 }
0040 
0041 #endif