blob: 951ddb8d8fdcfb915f4748ed7e30282b8ae0f678 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
.\" $OpenBSD: pthread_attr_init.3,v 1.7 2007/05/31 19:19:36 jmc Exp $
.\" Manual page derived from TOG's UNIX98 documentation.
.\"
.\" David Leonard, 2000. Public Domain.
.\"
.Dd $Mdocdate: May 31 2007 $
.Dt PTHREAD_ATTR_INIT 3
.Os
.Sh NAME
.Nm pthread_attr_init ,
.Nm pthread_attr_destroy
.Nd initialise and destroy threads attribute object
.Sh SYNOPSIS
.Fd #include <pthread.h>
.Ft int
.Fn pthread_attr_init "pthread_attr_t *attr"
.Ft int
.Fn pthread_attr_destroy "pthread_attr_t *attr"
.Sh DESCRIPTION
The function
.Fn pthread_attr_init
initialises a thread attributes
object
.Fa attr
with the default value for all of the individual
attributes used by a given implementation.
.Pp
The resulting attribute object (possibly modified by setting
individual attribute values), when used by
.Xr pthread_create 3 ,
defines the attributes of the thread created.
A single attributes object can be used in multiple simultaneous calls to
.Xr pthread_create 3 .
.Pp
The
.Fn pthread_attr_destroy
function is used to destroy a thread
attributes object. An implementation may cause
.Fn pthread_attr_destroy
to set
.Fa attr
to an implementation-dependent
invalid value.
The behaviour of using the attribute after it has
been destroyed is undefined.
.Sh RETURN VALUES
Upon successful completion,
.Fn pthread_attr_init
and
.Fn pthread_attr_destroy
return a value of 0.
Otherwise, an error number is returned to indicate the error.
.Sh ERRORS
The
.Fn pthread_attr_init
function will fail if:
.Bl -tag -width Er
.It Bq Er ENOMEM
Insufficient memory exists to initialise the thread attributes
object.
.El
.Pp
These functions will not return an error code of
.Bq Er EINTR .
.Sh SEE ALSO
.Xr pthread_attr_setdetachstate 3 ,
.Xr pthread_attr_setstackaddr 3 ,
.Xr pthread_attr_setstacksize 3 ,
.Xr pthread_create 3 ,
.Xr pthreads 3
.Sh STANDARDS
.Fn pthread_create
conforms to ISO/IEC 9945-1 ANSI/IEEE
.Pq Dq Tn POSIX
Std 1003.1 Second Edition 1996-07-12.
|