1 #ifndef OSMIUM_THREAD_UTIL_HPP
2 #define OSMIUM_THREAD_UTIL_HPP
42 # include <sys/prctl.h>
56 if (future.valid() && future.wait_for(std::chrono::seconds(0)) == std::future_status::ready) {
77 prctl(PR_SET_NAME, name, 0, 0, 0);
93 template <
typename TFunction,
typename... TArgs>
95 m_thread(
std::forward<TFunction>(f),
std::forward<TArgs>(args)...) {
thread_handler(const thread_handler &)=delete
thread_handler & operator=(const thread_handler &)=delete
std::thread m_thread
Definition: util.hpp:87
thread_handler(TFunction &&f, TArgs &&... args)
Definition: util.hpp:94
thread_handler(thread_handler &&) noexcept=default
void set_thread_name(const char *name) noexcept
Definition: util.hpp:76
void check_for_exception(std::future< T > &future)
Definition: util.hpp:55
void wait_until_done(std::future< T > &future)
Definition: util.hpp:66
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:551