thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, thrd_yield - C11 thread functions
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg);
int thrd_detach(thrd_t thr);
int thrd_equal(thrd_t thr0, thrd_t thr1);
_Noreturn void thrd_exit(int res);
int thrd_join(thrd_t thr, int *res);
int thrd_sleep(const struct timespec *duration, struct timespec *remaining);
The thrd_create(), thrd_current(), thrd_detach(), thrd_equal(), thrd_exit(), thrd_join(), thrd_sleep(), and thrd_yield() functions are part of the threads interfaces as specified in the C11 standard. With the exception of thrd_sleep() and thrd_yield() functions, they are simple wrappers over the more general pthreads functions. See INCITS/ISO/IEC 9899:2011.
Upon successful completion, the thrd_create(), thrd_detach(), and thrd_join() functions return thrd_success. If memory allocation fails for the requested thread, thrd_create() returns thrd_nomem. Otherwise, thrd_create(), thrd_detach(), and thrd_join() return thrd_error to indicate the error.
The thrd_current() function returns the thread identifier of the calling thread.
The thrd_equal() function returns a non-zero value if thr0 and thr1 refer to the same thread. Otherwise, 0 is returned.
If the thrd_sleep() function returns because the requested time has elapsed, it's return value is 0. Otherwise if thrd_sleep() has been interrupted by a signal or fails, −1 is returned.
No value is returned by either the thrd_exit() function or the thrd_yield() function.
See attributes(7) for descriptions of the following attributes: