Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/thread.h
+++ new/usr/src/head/thread.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 #ifndef _THREAD_H
28 30 #define _THREAD_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 /*
33 33 * thread.h:
34 34 * definitions needed to use the thread interface except synchronization.
35 35 * use <synch.h> for thread synchronization.
36 36 */
37 37
38 38 #ifndef _ASM
39 39 #include <sys/signal.h>
40 40 #include <sys/time.h>
41 41 #include <synch.h>
42 42 #endif /* _ASM */
43 43
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
44 44 #ifdef __cplusplus
45 45 extern "C" {
46 46 #endif
47 47
48 48 #ifndef _ASM
49 49 typedef unsigned int thread_t;
50 50 typedef unsigned int thread_key_t;
51 51 #endif /* _ASM */
52 52
53 53 #ifndef _ASM
54 -#ifdef __STDC__
55 54
56 55 extern int thr_create(void *, size_t, void *(*)(void *), void *, long,
57 56 thread_t *);
58 57 extern int thr_join(thread_t, thread_t *, void **);
59 58 extern int thr_setconcurrency(int);
60 59 extern int thr_getconcurrency(void);
61 60 extern void thr_exit(void *) __NORETURN;
62 61 extern thread_t thr_self(void);
63 62
64 63 /*
65 64 * the definition of thr_sigsetmask() is not strict ansi-c since sigset_t is
66 65 * not in the strict ansi-c name space. Hence, include the prototype for
67 66 * thr_sigsetmask() only if strict ansi-c conformance is not turned on.
68 67 */
69 68 #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
70 69 extern int thr_sigsetmask(int, const sigset_t *, sigset_t *);
71 70 #endif
72 71
73 72 /*
74 73 * the definition of thr_stksegment() is not strict ansi-c since stack_t is
75 74 * not in the strict ansi-c name space. Hence, include the prototype for
76 75 * thr_stksegment() only if strict ansi-c conformance is not turned on.
77 76 */
78 77 #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
79 78 extern int thr_stksegment(stack_t *);
80 79 #endif
81 80
82 81 extern int thr_main(void);
83 82 extern int thr_kill(thread_t, int);
84 83 extern int thr_suspend(thread_t);
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
85 84 extern int thr_continue(thread_t);
86 85 extern void thr_yield(void);
87 86 extern int thr_setprio(thread_t, int);
88 87 extern int thr_getprio(thread_t, int *);
89 88 extern int thr_keycreate(thread_key_t *, void(*)(void *));
90 89 extern int thr_keycreate_once(thread_key_t *, void(*)(void *));
91 90 extern int thr_setspecific(thread_key_t, void *);
92 91 extern int thr_getspecific(thread_key_t, void **);
93 92 extern size_t thr_min_stack(void);
94 93
95 -#else /* __STDC */
96 -
97 -extern int thr_create();
98 -extern int thr_join();
99 -extern int thr_setconcurrency();
100 -extern int thr_getconcurrency();
101 -extern void thr_exit();
102 -extern thread_t thr_self();
103 -extern int thr_sigsetmask();
104 -extern int thr_stksegment();
105 -extern int thr_main();
106 -extern int thr_kill();
107 -extern int thr_suspend();
108 -extern int thr_continue();
109 -extern void thr_yield();
110 -extern int thr_setprio();
111 -extern int thr_getprio();
112 -extern int thr_keycreate();
113 -extern int thr_keycreate_once();
114 -extern int thr_setspecific();
115 -extern int thr_getspecific();
116 -extern size_t thr_min_stack();
117 -
118 -#endif /* __STDC */
119 94 #endif /* _ASM */
120 95
121 96 #define THR_MIN_STACK thr_min_stack()
122 97 /*
123 98 * thread flags (one word bit mask)
124 99 */
125 100 /*
126 101 * POSIX.1c Note:
127 102 * THR_BOUND is defined same as PTHREAD_SCOPE_SYSTEM in <pthread.h>
128 103 * THR_DETACHED is defined same as PTHREAD_CREATE_DETACHED in <pthread.h>
129 104 * Any changes in these definitions should be reflected in <pthread.h>
130 105 */
131 106 #define THR_BOUND 0x00000001 /* = PTHREAD_SCOPE_SYSTEM */
132 107 #define THR_NEW_LWP 0x00000002
133 108 #define THR_DETACHED 0x00000040 /* = PTHREAD_CREATE_DETACHED */
134 109 #define THR_SUSPENDED 0x00000080
135 110 #define THR_DAEMON 0x00000100
136 111
137 112 /*
138 113 * The key to be created by thr_keycreate_once()
139 114 * must be statically initialized with THR_ONCE_KEY.
140 115 * This must be the same as PTHREAD_ONCE_KEY_NP in <pthread.h>
141 116 */
142 117 #define THR_ONCE_KEY (thread_key_t)(-1)
143 118
144 119 /*
145 120 * The available register states returned by thr_getstate().
146 121 */
147 122 #define TRS_VALID 0
148 123 #define TRS_NONVOLATILE 1
149 124 #define TRS_LWPID 2
150 125 #define TRS_INVALID 3
151 126
152 127 #ifdef __cplusplus
153 128 }
154 129 #endif
155 130
156 131 #endif /* _THREAD_H */
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX