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);
95 template <
typename TFunction,
typename... TArgs>
97 m_thread(
std::forward<TFunction>(f),
std::forward<TArgs>(args)...) {
107 if (m_thread.joinable()) {
118 #endif // OSMIUM_THREAD_UTIL_HPP thread_handler()
Definition: util.hpp:91
~thread_handler()
Definition: util.hpp:106
void set_thread_name(const char *name) noexcept
Definition: util.hpp:76
Definition: reader_iterator.hpp:39
thread_handler(TFunction &&f, TArgs &&... args)
Definition: util.hpp:96
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
std::thread m_thread
Definition: util.hpp:87
thread_handler & operator=(const thread_handler &)=delete
void check_for_exception(std::future< T > &future)
Definition: util.hpp:55
void wait_until_done(std::future< T > &future)
Definition: util.hpp:66