hpx/threading/thread.hpp

See Public API for a list of names and headers that are part of the public HPX API.

template<>
struct hash<::hpx::thread::id>

Public Functions

std::size_t operator()(::hpx::thread::id const &id) const
namespace hpx

Typedefs

using thread_termination_handler_type = hpx::function<void(std::exception_ptr const &e)>

Functions

void set_thread_termination_handler(thread_termination_handler_type f)
void swap(thread &x, thread &y)
bool operator==(thread::id const &x, thread::id const &y)
bool operator!=(thread::id const &x, thread::id const &y)
bool operator<(thread::id const &x, thread::id const &y)
bool operator>(thread::id const &x, thread::id const &y)
bool operator<=(thread::id const &x, thread::id const &y)
bool operator>=(thread::id const &x, thread::id const &y)
template<typename Char, typename Traits>
std::basic_ostream<Char, Traits> &operator<<(std::basic_ostream<Char, Traits> &out, thread::id const &id)
class thread

Public Types

typedef threads::thread_id_type native_handle_type

Public Functions

thread()
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename std::decay<F>::type, thread>::value>::type>
thread(F &&f)
template<typename F, typename ...Ts>
thread(F &&f, Ts&&... vs)
template<typename F>
thread(threads::thread_pool_base *pool, F &&f)
template<typename F, typename ...Ts>
thread(threads::thread_pool_base *pool, F &&f, Ts&&... vs)
~thread()
thread(thread&&)
thread &operator=(thread&&)
void swap(thread&)
bool joinable() const
void join()
void detach()
id get_id() const
native_handle_type native_handle() const
void interrupt(bool flag = true)
bool interruption_requested() const
hpx::future<void> get_future(error_code &ec = throws)
std::size_t get_thread_data() const
std::size_t set_thread_data(std::size_t)

Public Static Functions

static unsigned int hardware_concurrency()
static void interrupt(id, bool flag = true)

Private Types

typedef hpx::spinlock mutex_type

Private Functions

void terminate(const char *function, const char *reason) const
bool joinable_locked() const
void detach_locked()
void start_thread(threads::thread_pool_base *pool, hpx::move_only_function<void()> &&func)

Private Members

mutex_type mtx_
threads::thread_id_ref_type id_

Private Static Functions

static threads::thread_result_type thread_function_nullary(hpx::move_only_function<void()> const &func)
class id

Public Functions

id()
id(threads::thread_id_type const &i)
id(threads::thread_id_type &&i)
id(threads::thread_id_ref_type const &i)
id(threads::thread_id_ref_type &&i)
threads::thread_id_type const &native_handle() const

Private Members

threads::thread_id_type id_

Friends

friend hpx::thread
bool operator==(thread::id const &x, thread::id const &y)
bool operator!=(thread::id const &x, thread::id const &y)
bool operator<(thread::id const &x, thread::id const &y)
bool operator>(thread::id const &x, thread::id const &y)
bool operator<=(thread::id const &x, thread::id const &y)
bool operator>=(thread::id const &x, thread::id const &y)
template<typename Char, typename Traits>
std::basic_ostream<Char, Traits> &operator<<(std::basic_ostream<Char, Traits> &out, thread::id const &id)
namespace this_thread

Functions

thread::id get_id()
void yield()
void yield_to(thread::id)
threads::thread_priority get_priority()
std::ptrdiff_t get_stack_size()
void interruption_point()
bool interruption_enabled()
bool interruption_requested()
void interrupt()
void sleep_until(hpx::chrono::steady_time_point const &abs_time)
void sleep_for(hpx::chrono::steady_duration const &rel_time)
std::size_t get_thread_data()
std::size_t set_thread_data(std::size_t)
class disable_interruption

Public Functions

disable_interruption()
~disable_interruption()

Private Functions

disable_interruption(disable_interruption const&)
disable_interruption &operator=(disable_interruption const&)

Private Members

bool interruption_was_enabled_

Friends

friend hpx::this_thread::restore_interruption
class restore_interruption

Public Functions

restore_interruption(disable_interruption &d)
~restore_interruption()

Private Functions

restore_interruption(restore_interruption const&)
restore_interruption &operator=(restore_interruption const&)

Private Members

bool interruption_was_enabled_
namespace std
template<>
struct hash<::hpx::thread::id>

Public Functions

std::size_t operator()(::hpx::thread::id const &id) const