| Function POSIX equivalent
The thrd_exit function returns an integer value to the thread calling thrd_join, whereas the pthread_exit function uses a pointer.
The mutex created by mtx_init can be of type mtx_plain or mtx_timed to distinguish between a mutex that supports mtx_timedlock. This type can be ord with mtx_recursive to create a mutex that allows recursive acquisition. These properties are normally set using pthread_mutex_init s attr parameter.
If successful, the cnd_broadcast, cnd_init, cnd_signal, cnd_timedwait, cnd_wait, mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, thrd_create, thrd_detach, thrd_equal, thrd_join, thrd_sleep, tss_create and tss_set functions return thrd_success. Otherwise an error code will be returned to indicate the error.
The thrd_current function returns the thread ID of the calling thread.
The tss_get function returns the thread-specific data value associated with the given key. If no thread-specific data value is associated with key, then the value NULL is returned.
The cnd_init and thrd_create functions will fail if:
thrd_nomem The system has insufficient memory.
The cnd_timedwait and mtx_timedlock functions will fail if:
thrd_timedout The system time has reached or exceeded the time specified in ts before the operation could be completed.
The mtx_trylock function will fail if:
thrd_busy The mutex is already locked.
In all other cases, these functions may fail by returning general error code thrd_error.
These functions are expected to conform to -isoC-2011.
These functions appeared in
.Fx 10.0 .
.An Ed Schouten Aq ed@FreeBSD.org