pthread_attr_init(PTHREAD)
pthread_attr_init, pthread_attr_destroy --
initialise and destroy threads attribute object
Synopsis
cc [options] -Kthread file
#include <pthread.h>
int pthread_attr_init(pthread_attr_t *attr);
int pthread_attr_destroy(pthread_attr_t *attr);
Description
pthread_attr_init
initialises a thread attributes object
attr
with the default value for all of the individual attributes.
Default values defined are PTHREAD_CREATE_JOINABLE,
PTHREAD_SCOPE_PROCESS and PTHREAD_INHERIT_SCHED
The resulting attribute object
(possibly modified by setting individual attribute values),
when used by
pthread_create(PTHREAD)
defines the attributes of the thread created.
A single attributes object can be used in multiple simultaneous calls to
pthread_create.
pthread_attr_destroy
is used to destroy a thread attributes object.
An attempt to use an attribute after it has been destroyed will
generally cause an error.
Return values
Upon successful completion,
pthread_attr_init
and
pthread_attr_destroy
return a value of 0.
Otherwise, an error number is returned to indicate the error.
Diagnostics
If the follwing condition is detected,
pthread_attr_init
will return the corresponding value:
ENOMEM-
insufficient memory to initialise the thread attributes object
References
pthread_attr_setstackaddr(PTHREAD),
pthread_attr_setstacksize(PTHREAD),
pthread_attr_setdetachstate(PTHREAD),
pthread_attr_setinheritsched(PTHREAD),
pthread_attr_setschedparam(PTHREAD),
pthread_attr_setscope(PTHREAD),
pthread_create(PTHREAD),
pthread_create(PTHREAD),
pthread_create(PTHREAD),
pthread_create(PTHREAD),
pthread(F)
Standards compliance
The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005