From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/thread%2Fthrd_exit.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 devdocs/c/thread%2Fthrd_exit.html (limited to 'devdocs/c/thread%2Fthrd_exit.html') diff --git a/devdocs/c/thread%2Fthrd_exit.html b/devdocs/c/thread%2Fthrd_exit.html new file mode 100644 index 00000000..03680641 --- /dev/null +++ b/devdocs/c/thread%2Fthrd_exit.html @@ -0,0 +1,25 @@ +

thrd_exit

Defined in header <threads.h>
_Noreturn void thrd_exit( int res );
+(since C11)
(until C23) +
[[noreturn]] void thrd_exit( int res );
+
(since C23)

First, for every thread-specific storage key which was created with a non-null destructor and for which the associated value is non-null (see tss_create), thrd_exit sets the value associated with the key to NULL and then invokes the destructor with the previous value of the key. The order in which the destructors are invoked is unspecified.

+

If, after this, there remain keys with both non-null destructors and values (e.g. if a destructor executed tss_set), the process is repeated up to TSS_DTOR_ITERATIONS times.

+

Finally, the thrd_exit function terminates execution of the calling thread and sets its result code to res.

+

If the last thread in the program is terminated with thrd_exit, the entire program terminates as if by calling exit with EXIT_SUCCESS as the argument (so the functions registered by atexit are executed in the context of that last thread)

+

Parameters

+ +
res - the result value to return

Return value

(none)

+

References

See also

+ +
+
(C11)
blocks until a thread terminates
(function)
+
(C11)
detaches a thread
(function)
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/thread/thrd_exit +

+
-- cgit v1.2.3