4 #ifndef __FRIOS_POSIX_THREADS_THREAD_ATTR_HPP__
5 #define __FRIOS_POSIX_THREADS_THREAD_ATTR_HPP__
47 int fail = pthread_attr_init(&_attr);
53 : _attr(std::move(tmp._attr))
60 pthread_attr_destroy(&_attr);
76 pthread_attr_getdetachstate(&_attr, &state);
83 pthread_attr_setdetachstate(&_attr,
int(state));
90 #endif // include guard
Wrapper around POSIX thread attributes.
Definition: thread_attr.hpp:22
Exception class for thread attribute initialization errors.
Definition: thread_attr.hpp:34
the thread should be started as detached
thread_attr(void)
Default construction of the thread attributes.
Definition: thread_attr.hpp:45
void set_detach_state(detach_state state)
Sets the detach state of the thread.
Definition: thread_attr.hpp:81
Base class for all POSIX exceptions.
Definition: error.hpp:14
detach_state
Thread detach state enumeration.
Definition: thread_attr.hpp:64
Utility for ensuring uniqueness of a variable.
the thread should be started as joinable
Declaration of exception classes for POSIX errors.
thread_attr(thread_attr &&tmp)
Thread attributes are moveable.
Definition: thread_attr.hpp:52
error(int error_code)
Construction from POSIX error code.
Definition: error.hpp:26
Wrapper around a POSIX thread.
Definition: thread.hpp:25
~thread_attr(void)
Releases any resources associated with the thread attributes.
Definition: thread_attr.hpp:57
detach_state get_detach_state(void) const
Gets the detach state set in the attributes.
Definition: thread_attr.hpp:73