Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 8
Initialize a thread-attribute object
#include <pthread.h>
int pthread_attr_init( pthread_attr_t *attr );
- attr
- A pointer to the pthread_attr_t structure that you want
to initialize.
For more information, see below.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The pthread_attr_init() function initializes the thread
attributes in the thread attribute object attr to their
default values:
- Cancellation requests may be acted on according to the cancellation type
(PTHREAD_CANCEL_DEFERRED).
- Cancellation requests are held pending until a cancellation point
(PTHREAD_CANCEL_ENABLE).
- Threads are put into a zombie state when they terminate, and
they stay in this state until you retrieve their exit status or detach
them (PTHREAD_CREATE_JOINABLE).
- Threads inherit the scheduling policy of their parent thread
(PTHREAD_INHERIT_SCHED).
- Threads are scheduled against all threads in the system
(PTHREAD_SCOPE_SYSTEM).
- The stack attributes are set so that the kernel will allocate
a 4 KB stack for new threads and free the stacks when the threads
terminate.
After initialization, you can use the pthread_attr_* family
of functions to get and set the attributes:
You can also set some non-POSIX attributes; for more information, see
“QNX extensions,”
in the documentation for pthread_create().
You can then pass the attribute object to
pthread_create()
to create a thread with the required attributes.
You can use the same attribute object in multiple calls to
pthread_create().
The effect of initializing an already-initialized thread-attribute object
is undefined.
- EOK
- Success.
POSIX 1003.1 THR
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
pthread_attr_destroy(),
pthread_create()
Processes and Threads
chapter of Getting Started with QNX Neutrino
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 239
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_attr_init.html on line 239