]>
Commit | Line | Data |
---|---|---|
f1a1da6c A |
1 | .\" Copyright (c) 2004-2007 Apple Inc. All rights reserved. |
2 | .Dd December 31, 2007 | |
3 | .Dt PTHREAD_ATTR 3 | |
4 | .Os | |
5 | .Sh NAME | |
6 | .Nm pthread_attr_getinheritsched , | |
a0619f9c | 7 | .Nm pthread_attr_setinheritsched |
f1a1da6c A |
8 | .Nd thread attribute operations |
9 | .Sh SYNOPSIS | |
10 | .Fd #include <pthread.h> | |
11 | .Ft int | |
12 | .Fo pthread_attr_getinheritsched | |
13 | .Fa "const pthread_attr_t *restrict attr" | |
14 | .Fa "int *restrict inheritsched" | |
15 | .Fc | |
16 | .Ft int | |
17 | .Fo pthread_attr_setinheritsched | |
18 | .Fa "pthread_attr_t *attr" | |
19 | .Fa "int inheritsched" | |
20 | .Fc | |
21 | .Sh DESCRIPTION | |
22 | Thread attributes are used to specify parameters to | |
23 | .Fn pthread_create . | |
24 | One attribute object can be used in multiple calls to | |
25 | .Fn pthread_create , | |
26 | with or without modifications between calls. | |
27 | .Pp | |
28 | One of the thread attributes of interest is the "inheritsched" attribute. This attribute | |
29 | controls the scheduling policy and related attributes of the newly created thread. The values of the | |
30 | "inheritsched" attribute can be either PTHREAD_INHERIT_SCHED or PTHREAD_EXPLICIT_SCHED. | |
31 | .Pp | |
32 | PTHREAD_INHERIT_SCHED | |
a0619f9c | 33 | .Pp |
f1a1da6c A |
34 | Indicates that the newly created thread should inherit all it's scheduling related attributes from it's creating |
35 | thread. It ignores the values of the relevant attributes within the | |
36 | .Fa attr | |
37 | argument. | |
38 | .Pp | |
39 | PTHREAD_EXPLICIT_SCHED | |
40 | .Pp | |
41 | Indicates that the newly created thread should set it's scheduling related attributes based on | |
42 | .Fa attr | |
43 | argument. | |
44 | .Pp | |
45 | The | |
46 | .Fn pthread_attr_setinheritsched | |
47 | functions set the "inheritsched" attribute within the | |
48 | .Fa attr | |
49 | argument to the desired value. | |
50 | .Pp | |
51 | The | |
52 | .Fn pthread_attr_getinheritsched | |
53 | functions copy the value of the "inheritsched" attribute to the location pointed to by the second function parameter. | |
54 | .Sh RETURN VALUES | |
55 | If successful, these functions return 0. | |
56 | Otherwise, an error number is returned to indicate the error. | |
57 | .Sh ERRORS | |
58 | .Pp | |
59 | .Fn pthread_attr_getinheritsched | |
60 | will fail if: | |
61 | .Bl -tag -width Er | |
62 | .\" ======== | |
63 | .It Bq Er EINVAL | |
64 | Invalid value for | |
65 | .Fa attr . | |
66 | .El | |
67 | .Pp | |
68 | .Fn pthread_attr_setinheritsched | |
69 | will fail if: | |
70 | .Bl -tag -width Er | |
71 | .\" ======== | |
72 | .It Bq Er EINVAL | |
73 | Invalid value for | |
74 | .Fa attr . | |
75 | .El | |
a0619f9c A |
76 | .Sh BUGS |
77 | .Pp | |
78 | The "inheritsched" attribute has no effect on Darwin. It is provided for compatibility only. | |
f1a1da6c A |
79 | .Sh SEE ALSO |
80 | .Xr pthread_create 3 , | |
81 | .Xr pthread_attr_init 3 , | |
82 | .Xr pthread_attr_setschedparam 3 | |
83 | .Sh STANDARDS | |
84 | .Pp | |
85 | .Fn pthread_attr_setinheritsched , | |
86 | .Fn pthread_attr_getinheritsched | |
87 | conform to | |
88 | .St -susv2 |