threading¶
The contents of this module can be included with the header
hpx/modules/threading.hpp. These headers may be used by user-code but are not
guaranteed stable (neither header location nor contents). You are using these at
your own risk. If you wish to use non-public functionality from a module we
strongly suggest only including the module header hpx/modules/threading.hpp, not
the particular header in which the functionality you would like to use is
defined. See Public API for a list of names that are part of the public
HPX API.
Header hpx/thread.hpp¶
Header hpx/threading/jthread.hpp¶
-
namespace
hpx -
-
class
jthread¶ - #include <jthread.hpp>
Public Functions
-
jthread()¶
-
template<typename
F, typename ...Ts, typenameEnable= typename std::enable_if<!std::is_same<typename std::decay<F>::type, jthread>::value>::type>jthread(F &&f, Ts&&... ts)¶
-
~jthread()¶
-
HPX_NODISCARD bool hpx::jthread::joinable() const
-
void
join()¶
-
void
detach()¶
-
HPX_NODISCARD id hpx::jthread::get_id() const
-
HPX_NODISCARD native_handle_type hpx::jthread::native_handle()
-
HPX_NODISCARD stop_source hpx::jthread::get_stop_source()
-
HPX_NODISCARD stop_token hpx::jthread::get_stop_token() const
-
bool
request_stop()¶
Public Static Functions
-
static HPX_NODISCARD unsigned int hpx::jthread::hardware_concurrency()
Private Static Functions
-
template<typename
F, typename ...Ts>
static voidinvoke(std::false_type, F &&f, stop_token &&st, Ts&&... ts)¶
-
template<typename
F, typename ...Ts>
static voidinvoke(std::true_type, F &&f, stop_token &&st, Ts&&... ts)¶
-
-
class
Header hpx/threading/thread.hpp¶
-
namespace
hpx Typedefs
-
using
thread_termination_handler_type= util::function_nonser<void(std::exception_ptr const &e)>¶
Functions
-
void
set_thread_termination_handler(thread_termination_handler_type f)¶
-
class
thread¶ - #include <thread.hpp>
Public Types
-
typedef threads::thread_id_type
native_handle_type¶
Public Functions
-
thread()¶
-
template<typename
F, typenameEnable= typename std::enable_if<!std::is_same<typename hpx::util::decay<F>::type, thread>::value>::type>thread(F &&f)¶
-
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()¶
-
bool
joinable() const¶
-
void
join()¶
-
void
detach()¶
-
native_handle_type
native_handle() const¶
-
void
interrupt(bool flag = true)¶
-
bool
interruption_requested() const¶
-
lcos::future<void>
get_future(error_code &ec = throws)¶
Public Static Functions
-
static HPX_NODISCARD unsigned int hpx::thread::hardware_concurrency()
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, util::unique_function_nonser<void()> &&func)¶
Private Static Functions
-
static threads::thread_result_type
thread_function_nullary(util::unique_function_nonser<void()> const &func)¶
-
class
id¶ - #include <thread.hpp>
Public Functions
-
id()¶
-
id(threads::thread_id_type const &i)¶
-
id(threads::thread_id_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)¶
-
-
typedef threads::thread_id_type
-
namespace
this_thread Functions
-
void
yield()¶
-
threads::thread_priority
get_priority()¶
-
void
interruption_point()¶
-
bool
interruption_enabled()¶
-
bool
interruption_requested()¶
-
void
interrupt()¶
-
void
sleep_until(util::steady_time_point const &abs_time)¶
-
void
sleep_for(util::steady_duration const &rel_time)¶
-
class
disable_interruption¶ - #include <thread.hpp>
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¶ - #include <thread.hpp>
Private Functions
-
restore_interruption(restore_interruption const&)¶
-
restore_interruption &
operator=(restore_interruption const&)¶
Private Members
-
bool
interruption_was_enabled_¶
-
-
void
-
using