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_create.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 devdocs/c/thread%2Fthrd_create.html (limited to 'devdocs/c/thread%2Fthrd_create.html') diff --git a/devdocs/c/thread%2Fthrd_create.html b/devdocs/c/thread%2Fthrd_create.html new file mode 100644 index 00000000..f81cb8fa --- /dev/null +++ b/devdocs/c/thread%2Fthrd_create.html @@ -0,0 +1,29 @@ +

thrd_create

Defined in header <threads.h>
int thrd_create( thrd_t *thr, thrd_start_t func, void *arg );
+
(since C11)

Creates a new thread executing the function func. The function is invoked as func(arg).

+

If successful, the object pointed to by thr is set to the identifier of the new thread.

+

The completion of this function synchronizes-with the beginning of the thread.

+

Parameters

+ + + +
thr - pointer to memory location to put the identifier of the new thread
func - function to execute
arg - argument to pass to the function

Return value

thrd_success if the creation of the new thread was successful. Otherwise returns thrd_nomem if there was insufficient amount of memory or thrd_error if another error occurred.

+

Notes

The thread identifiers may be reused for new threads once the thread has finished and joined or detached.

+

The type thrd_start_t is a typedef of int(*)(void*), which differs from the POSIX equivalent void*(*)(void*)

+

All thread-specific storage values (see tss_create) are initialized to NULL.

+

Return from the function func is equivalent to calling thrd_exit with the argument equal to the return value of func.

+

References

See also

+ + +
+
(C11)
detaches a thread
(function)
+
(C11)
blocks until a thread terminates
(function)
C++ documentation for thread
+

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

+
-- cgit v1.2.3