Adelsbach Enhanced Threading Library

Manual Pages (DD-00013-001)

Enhanced Threading Library > thrd_exit (3)
HTML TXT PDF PS
thrd_exit(3) Library Functions Manual thrd_exit(3)

thrd_exitterminate a thread

library “threads”
#include <threads.h>

void
thrd_exit(int code);

The function () will terminate the current thread with an arbitrary exit code code that any waiting threads can retrieve using thrd_join(3).

The thread will call any destructors for thread-local storage that have been set using tss_create(3) whilst blocking signals.

If the subroutine of a thread returns () will be implicitly called and the status code will be set to the return value of the thread function.

The function thrd_exit() does not return.

thrd_create(3) thrd_sleep(3) thrd_yield(3) thrd_equal(3) thrd_detach(3) thrd_current(3) thrd_join(3)

The thrd_exit() function first appeared in the C11 standard ISO/IEC 9899:2011.

Jan Adelsbach <jan@jadelsbach.de>

May 9, 2020 Debian