LLVM  14.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 (llvm::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 llvm::Optional< unsigned > DefaultStackSize = None
 

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 56 of file thread.h.

◆ native_handle_type

Definition at line 55 of file thread.h.

◆ start_routine_type

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

Definition at line 57 of file thread.h.

Constructor & Destructor Documentation

◆ thread() [1/5]

llvm::thread::thread ( )
inline

Definition at line 77 of file thread.h.

◆ thread() [2/5]

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

Definition at line 78 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 82 of file thread.h.

◆ thread() [4/5]

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

Definition at line 130 of file thread.h.

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

◆ thread() [5/5]

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

◆ ~thread()

llvm::thread::~thread ( )
inline

Definition at line 90 of file thread.h.

References joinable().

Member Function Documentation

◆ detach()

void llvm::thread::detach ( )
inline

Definition at line 153 of file thread.h.

References llvm::llvm_thread_detach_impl().

◆ get_id()

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

Definition at line 144 of file thread.h.

References llvm::llvm_thread_get_id_impl().

◆ hardware_concurrency()

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

Definition at line 108 of file thread.h.

References llvm::hardware_concurrency().

◆ join()

void llvm::thread::join ( )
inline

Definition at line 148 of file thread.h.

References llvm::llvm_thread_join_impl().

◆ joinable()

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

Definition at line 102 of file thread.h.

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

◆ native_handle()

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

Definition at line 106 of file thread.h.

◆ operator=()

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

Definition at line 95 of file thread.h.

References joinable(), and Other.

◆ swap()

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

Definition at line 115 of file thread.h.

References Other, and std::swap().

◆ ThreadProxy()

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

Definition at line 59 of file thread.h.

Member Data Documentation

◆ DefaultStackSize

const llvm::Optional< unsigned > llvm::thread::DefaultStackSize = None
static

Definition at line 75 of file thread.h.


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