LLVM  17.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::thread Class Reference

LLVM thread following std::thread interface with added constructor to specify stack size. More...

#include "llvm/Support/thread.h"

Collaboration diagram for llvm::thread:
Collaboration graph
[legend]

Public Types

using native_handle_type = pthread_t
 
using id = pthread_t
 
using start_routine_type = void *(*)(void *)
 

Public Member Functions

 thread ()
 
 thread (thread &&Other) noexcept
 
template<class Function , class... Args>
 thread (Function &&f, Args &&...args)
 
template<class Function , class... Args>
 thread (std::optional< unsigned > StackSizeInBytes, Function &&f, Args &&...args)
 
 thread (const thread &)=delete
 
 ~thread ()
 
threadoperator= (thread &&Other) noexcept
 
bool joinable () const noexcept
 
id get_id () const noexcept
 
native_handle_type native_handle () const noexcept
 
void join ()
 
void detach ()
 
void swap (llvm::thread &Other) noexcept
 

Static Public Member Functions

template<typename CalleeTuple >
static void * ThreadProxy (void *Ptr)
 
static unsigned hardware_concurrency ()
 

Static Public Attributes

static const std::optional< unsigned > DefaultStackSize
 

Detailed Description

LLVM thread following std::thread interface with added constructor to specify stack size.

Definition at line 38 of file thread.h.

Member Typedef Documentation

◆ id

using llvm::thread::id = pthread_t

Definition at line 51 of file thread.h.

◆ native_handle_type

Definition at line 50 of file thread.h.

◆ start_routine_type

using llvm::thread::start_routine_type = void *(*)(void *)

Definition at line 52 of file thread.h.

Constructor & Destructor Documentation

◆ thread() [1/5]

llvm::thread::thread ( )
inline

Definition at line 72 of file thread.h.

◆ thread() [2/5]

llvm::thread::thread ( thread &&  Other)
inlinenoexcept

Definition at line 73 of file thread.h.

References Other.

◆ thread() [3/5]

template<class Function , class... Args>
llvm::thread::thread ( Function &&  f,
Args &&...  args 
)
inlineexplicit

Definition at line 77 of file thread.h.

◆ thread() [4/5]

template<class Function , class... Args>
llvm::thread::thread ( std::optional< unsigned >  StackSizeInBytes,
Function &&  f,
Args &&...  args 
)
explicit

Definition at line 125 of file thread.h.

References args, Callee, f(), and llvm::llvm_execute_on_thread_impl().

◆ thread() [5/5]

llvm::thread::thread ( const thread )
delete

◆ ~thread()

llvm::thread::~thread ( )
inline

Definition at line 85 of file thread.h.

References joinable().

Member Function Documentation

◆ detach()

void llvm::thread::detach ( )
inline

Definition at line 146 of file thread.h.

References llvm::llvm_thread_detach_impl().

◆ get_id()

thread::id llvm::thread::get_id ( ) const
inlinenoexcept

Definition at line 137 of file thread.h.

References llvm::llvm_thread_get_id_impl().

◆ hardware_concurrency()

static unsigned llvm::thread::hardware_concurrency ( )
inlinestatic

Definition at line 103 of file thread.h.

References llvm::hardware_concurrency().

◆ join()

void llvm::thread::join ( )
inline

Definition at line 141 of file thread.h.

References llvm::llvm_thread_join_impl().

◆ joinable()

bool llvm::thread::joinable ( ) const
inlinenoexcept

Definition at line 97 of file thread.h.

Referenced by operator=(), and ~thread().

◆ native_handle()

native_handle_type llvm::thread::native_handle ( ) const
inlinenoexcept

Definition at line 101 of file thread.h.

◆ operator=()

thread& llvm::thread::operator= ( thread &&  Other)
inlinenoexcept

Definition at line 90 of file thread.h.

References joinable(), and Other.

◆ swap()

void llvm::thread::swap ( llvm::thread Other)
inlinenoexcept

Definition at line 110 of file thread.h.

References Other, and std::swap().

◆ ThreadProxy()

template<typename CalleeTuple >
static void* llvm::thread::ThreadProxy ( void *  Ptr)
inlinestatic

Definition at line 54 of file thread.h.

References Ptr.

Member Data Documentation

◆ DefaultStackSize

const std::optional< unsigned > llvm::thread::DefaultStackSize
static

Definition at line 70 of file thread.h.


The documentation for this class was generated from the following files: