1 | /* states.inl |
---|
2 | * |
---|
3 | * This file contains the macro implementation of the inlined |
---|
4 | * routines associated with thread state information. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * All rights assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
11 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
12 | * notice must appear in all copies of this file and its derivatives. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __STATES_inl |
---|
18 | #define __STATES_inl |
---|
19 | |
---|
20 | /*PAGE |
---|
21 | * |
---|
22 | * _States_Set |
---|
23 | * |
---|
24 | */ |
---|
25 | |
---|
26 | STATIC INLINE States_Control _States_Set ( |
---|
27 | States_Control states_to_set, |
---|
28 | States_Control current_state |
---|
29 | ) |
---|
30 | { |
---|
31 | return (current_state | states_to_set); |
---|
32 | } |
---|
33 | |
---|
34 | /*PAGE |
---|
35 | * |
---|
36 | * _States_Clear |
---|
37 | * |
---|
38 | */ |
---|
39 | |
---|
40 | STATIC INLINE States_Control _States_Clear ( |
---|
41 | States_Control states_to_clear, |
---|
42 | States_Control current_state |
---|
43 | ) |
---|
44 | { |
---|
45 | return (current_state & ~states_to_clear); |
---|
46 | } |
---|
47 | |
---|
48 | /*PAGE |
---|
49 | * |
---|
50 | * _States_Is_ready |
---|
51 | * |
---|
52 | */ |
---|
53 | |
---|
54 | STATIC INLINE boolean _States_Is_ready ( |
---|
55 | States_Control the_states |
---|
56 | ) |
---|
57 | { |
---|
58 | return (the_states == STATES_READY); |
---|
59 | } |
---|
60 | |
---|
61 | /*PAGE |
---|
62 | * |
---|
63 | * _States_Is_only_dormant |
---|
64 | * |
---|
65 | */ |
---|
66 | |
---|
67 | STATIC INLINE boolean _States_Is_only_dormant ( |
---|
68 | States_Control the_states |
---|
69 | ) |
---|
70 | { |
---|
71 | return (the_states == STATES_DORMANT); |
---|
72 | } |
---|
73 | |
---|
74 | /*PAGE |
---|
75 | * |
---|
76 | * _States_Is_dormant |
---|
77 | * |
---|
78 | */ |
---|
79 | |
---|
80 | STATIC INLINE boolean _States_Is_dormant ( |
---|
81 | States_Control the_states |
---|
82 | ) |
---|
83 | { |
---|
84 | return (the_states & STATES_DORMANT); |
---|
85 | } |
---|
86 | |
---|
87 | /*PAGE |
---|
88 | * |
---|
89 | * _States_Is_suspended |
---|
90 | * |
---|
91 | */ |
---|
92 | |
---|
93 | STATIC INLINE boolean _States_Is_suspended ( |
---|
94 | States_Control the_states |
---|
95 | ) |
---|
96 | { |
---|
97 | return (the_states & STATES_SUSPENDED); |
---|
98 | } |
---|
99 | |
---|
100 | /*PAGE |
---|
101 | * |
---|
102 | * _States_Is_Transient |
---|
103 | * |
---|
104 | */ |
---|
105 | |
---|
106 | STATIC INLINE boolean _States_Is_transient ( |
---|
107 | States_Control the_states |
---|
108 | ) |
---|
109 | { |
---|
110 | return (the_states & STATES_TRANSIENT); |
---|
111 | } |
---|
112 | |
---|
113 | /*PAGE |
---|
114 | * |
---|
115 | * _States_Is_delaying |
---|
116 | * |
---|
117 | */ |
---|
118 | |
---|
119 | STATIC INLINE boolean _States_Is_delaying ( |
---|
120 | States_Control the_states |
---|
121 | ) |
---|
122 | { |
---|
123 | return (the_states & STATES_DELAYING); |
---|
124 | } |
---|
125 | |
---|
126 | /*PAGE |
---|
127 | * |
---|
128 | * _States_Is_waiting_for_buffer |
---|
129 | * |
---|
130 | */ |
---|
131 | |
---|
132 | STATIC INLINE boolean _States_Is_waiting_for_buffer ( |
---|
133 | States_Control the_states |
---|
134 | ) |
---|
135 | { |
---|
136 | return (the_states & STATES_WAITING_FOR_BUFFER); |
---|
137 | } |
---|
138 | |
---|
139 | /*PAGE |
---|
140 | * |
---|
141 | * _States_Is_waiting_for_segment |
---|
142 | * |
---|
143 | */ |
---|
144 | |
---|
145 | STATIC INLINE boolean _States_Is_waiting_for_segment ( |
---|
146 | States_Control the_states |
---|
147 | ) |
---|
148 | { |
---|
149 | return (the_states & STATES_WAITING_FOR_SEGMENT); |
---|
150 | } |
---|
151 | |
---|
152 | /*PAGE |
---|
153 | * |
---|
154 | * _States_Is_waiting_for_message |
---|
155 | * |
---|
156 | */ |
---|
157 | |
---|
158 | STATIC INLINE boolean _States_Is_waiting_for_message ( |
---|
159 | States_Control the_states |
---|
160 | ) |
---|
161 | { |
---|
162 | return (the_states & STATES_WAITING_FOR_MESSAGE); |
---|
163 | } |
---|
164 | |
---|
165 | /*PAGE |
---|
166 | * |
---|
167 | * _States_Is_waiting_for_event |
---|
168 | * |
---|
169 | */ |
---|
170 | |
---|
171 | STATIC INLINE boolean _States_Is_waiting_for_event ( |
---|
172 | States_Control the_states |
---|
173 | ) |
---|
174 | { |
---|
175 | return (the_states & STATES_WAITING_FOR_EVENT); |
---|
176 | } |
---|
177 | |
---|
178 | /*PAGE |
---|
179 | * |
---|
180 | * _States_Is_waiting_for_mutex |
---|
181 | * |
---|
182 | */ |
---|
183 | |
---|
184 | STATIC INLINE boolean _States_Is_waiting_for_mutex ( |
---|
185 | States_Control the_states |
---|
186 | ) |
---|
187 | { |
---|
188 | return (the_states & STATES_WAITING_FOR_MUTEX); |
---|
189 | } |
---|
190 | |
---|
191 | /*PAGE |
---|
192 | * |
---|
193 | * _States_Is_waiting_for_semaphore |
---|
194 | * |
---|
195 | */ |
---|
196 | |
---|
197 | STATIC INLINE boolean _States_Is_waiting_for_semaphore ( |
---|
198 | States_Control the_states |
---|
199 | ) |
---|
200 | { |
---|
201 | return (the_states & STATES_WAITING_FOR_SEMAPHORE); |
---|
202 | } |
---|
203 | |
---|
204 | /*PAGE |
---|
205 | * |
---|
206 | * _States_Is_waiting_for_time |
---|
207 | * |
---|
208 | */ |
---|
209 | |
---|
210 | STATIC INLINE boolean _States_Is_waiting_for_time ( |
---|
211 | States_Control the_states |
---|
212 | ) |
---|
213 | { |
---|
214 | return (the_states & STATES_WAITING_FOR_TIME); |
---|
215 | } |
---|
216 | |
---|
217 | /*PAGE |
---|
218 | * |
---|
219 | * _States_Is_waiting_for_rpc_reply |
---|
220 | * |
---|
221 | */ |
---|
222 | |
---|
223 | STATIC INLINE boolean _States_Is_waiting_for_rpc_reply ( |
---|
224 | States_Control the_states |
---|
225 | ) |
---|
226 | { |
---|
227 | return (the_states & STATES_WAITING_FOR_RPC_REPLY); |
---|
228 | } |
---|
229 | |
---|
230 | /*PAGE |
---|
231 | * |
---|
232 | * _States_Is_waiting_for_period |
---|
233 | * |
---|
234 | */ |
---|
235 | |
---|
236 | STATIC INLINE boolean _States_Is_waiting_for_period ( |
---|
237 | States_Control the_states |
---|
238 | ) |
---|
239 | { |
---|
240 | return (the_states & STATES_WAITING_FOR_PERIOD); |
---|
241 | } |
---|
242 | |
---|
243 | /*PAGE |
---|
244 | * |
---|
245 | * _States_Is_locally_blocked |
---|
246 | * |
---|
247 | */ |
---|
248 | |
---|
249 | STATIC INLINE boolean _States_Is_locally_blocked ( |
---|
250 | States_Control the_states |
---|
251 | ) |
---|
252 | { |
---|
253 | return (the_states & STATES_LOCALLY_BLOCKED); |
---|
254 | } |
---|
255 | |
---|
256 | /*PAGE |
---|
257 | * |
---|
258 | * _States_Is_waiting_on_thread_queue |
---|
259 | * |
---|
260 | */ |
---|
261 | |
---|
262 | STATIC INLINE boolean _States_Is_waiting_on_thread_queue ( |
---|
263 | States_Control the_states |
---|
264 | ) |
---|
265 | { |
---|
266 | return (the_states & STATES_WAITING_ON_THREAD_QUEUE); |
---|
267 | } |
---|
268 | |
---|
269 | /*PAGE |
---|
270 | * |
---|
271 | * _States_Is_blocked |
---|
272 | * |
---|
273 | */ |
---|
274 | |
---|
275 | STATIC INLINE boolean _States_Is_blocked ( |
---|
276 | States_Control the_states |
---|
277 | ) |
---|
278 | { |
---|
279 | return (the_states & STATES_BLOCKED); |
---|
280 | } |
---|
281 | |
---|
282 | /*PAGEPAGE |
---|
283 | * |
---|
284 | * |
---|
285 | * _States_Are_set |
---|
286 | * |
---|
287 | */ |
---|
288 | |
---|
289 | STATIC INLINE boolean _States_Are_set ( |
---|
290 | States_Control the_states, |
---|
291 | States_Control mask |
---|
292 | ) |
---|
293 | { |
---|
294 | return ( (the_states & mask) != STATES_READY); |
---|
295 | } |
---|
296 | |
---|
297 | #endif |
---|
298 | /* end of include file */ |
---|