1#ifndef OSMIUM_THREAD_UTIL_HPP
2#define OSMIUM_THREAD_UTIL_HPP
42# include <sys/prctl.h>
43#elif defined(__FreeBSD__)
58 if (future.valid() && future.wait_for(std::chrono::seconds(0)) == std::future_status::ready) {
79 prctl(PR_SET_NAME, name, 0, 0, 0);
81#elif defined(__FreeBSD__)
83 pthread_setname_np(pthread_self(), name);
99 template <
typename TFunction,
typename... TArgs>
101 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:93
thread_handler(TFunction &&f, TArgs &&... args)
Definition: util.hpp:100
thread_handler(thread_handler &&) noexcept=default
void set_thread_name(const char *name) noexcept
Definition: util.hpp:78
void check_for_exception(std::future< T > &future)
Definition: util.hpp:57
void wait_until_done(std::future< T > &future)
Definition: util.hpp:68
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:555