OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [include/] [rtems/] [score/] [threadq.h] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  threadq.h
2
 *
3
 *  This include file contains all the constants and structures associated
4
 *  with the manipulation of objects.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  threadq.h,v 1.12 2002/07/01 22:30:12 joel Exp
14
 */
15
 
16
#ifndef __THREAD_QUEUE_h
17
#define __THREAD_QUEUE_h
18
 
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
 
23
#include <rtems/score/tqdata.h>
24
 
25
#include <rtems/score/object.h>
26
#include <rtems/score/thread.h>
27
#include <rtems/score/watchdog.h>
28
 
29
/*
30
 *  Constant for indefinite wait.
31
 */
32
 
33
#define THREAD_QUEUE_WAIT_FOREVER  WATCHDOG_NO_TIMEOUT
34
 
35
/*
36
 *  The following type defines the callout used when a remote task
37
 *  is extracted from a local thread queue.
38
 */
39
 
40
typedef void ( *Thread_queue_Flush_callout )(
41
                 Thread_Control *
42
             );
43
 
44
/*
45
 *  The following type defines the callout used when a local task
46
 *  is extracted from a remote thread queue (i.e. it's proxy must
47
 *  extracted from the remote queue).
48
 */
49
 
50
#if 0
51
typedef void ( *Thread_queue_Extract_callout )(
52
                 Thread_Control *
53
             );
54
 
55
SCORE_EXTERN Thread_queue_Extract_callout
56
  _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
57
#endif
58
 
59
/*
60
 *  _Thread_queue_Dequeue
61
 *
62
 *  DESCRIPTION:
63
 *
64
 *  This function returns a pointer to a thread waiting on
65
 *  the_thread_queue.  The selection of this thread is based on
66
 *  the discipline of the_thread_queue.  If no threads are waiting
67
 *  on the_thread_queue, then NULL is returned.
68
 */
69
 
70
Thread_Control *_Thread_queue_Dequeue(
71
  Thread_queue_Control *the_thread_queue
72
);
73
 
74
/*
75
 *  _Thread_queue_Enqueue
76
 *
77
 *  DESCRIPTION:
78
 *
79
 *  This routine enqueues the currently executing thread on
80
 *  the_thread_queue with an optional timeout.
81
 */
82
 
83
void _Thread_queue_Enqueue(
84
  Thread_queue_Control *the_thread_queue,
85
  Watchdog_Interval     timeout
86
);
87
 
88
/*
89
 *  _Thread_queue_Extract
90
 *
91
 *  DESCRIPTION:
92
 *
93
 *  This routine removes the_thread from the_thread_queue
94
 *  and cancels any timeouts associated with this blocking.
95
 */
96
 
97
void _Thread_queue_Extract(
98
  Thread_queue_Control *the_thread_queue,
99
  Thread_Control       *the_thread
100
);
101
 
102
/*
103
 *  _Thread_queue_Extract_with_proxy
104
 *
105
 *  DESCRIPTION:
106
 *
107
 *  This routine extracts the_thread from the_thread_queue
108
 *  and ensures that if there is a proxy for this task on
109
 *  another node, it is also dealt with.
110
 */
111
 
112
boolean _Thread_queue_Extract_with_proxy(
113
  Thread_Control       *the_thread
114
);
115
 
116
/*
117
 *  _Thread_queue_First
118
 *
119
 *  DESCRIPTION:
120
 *
121
 *  This function returns a pointer to the "first" thread
122
 *  on the_thread_queue.  The "first" thread is selected
123
 *  based on the discipline of the_thread_queue.
124
 */
125
 
126
Thread_Control *_Thread_queue_First(
127
  Thread_queue_Control *the_thread_queue
128
);
129
 
130
/*
131
 *  _Thread_queue_Flush
132
 *
133
 *  DESCRIPTION:
134
 *
135
 *  This routine unblocks all threads blocked on the_thread_queue
136
 *  and cancels any associated timeouts.
137
 */
138
 
139
void _Thread_queue_Flush(
140
  Thread_queue_Control       *the_thread_queue,
141
  Thread_queue_Flush_callout  remote_extract_callout,
142
  unsigned32                  status
143
);
144
 
145
/*
146
 *  _Thread_queue_Initialize
147
 *
148
 *  DESCRIPTION:
149
 *
150
 *  This routine initializes the_thread_queue based on the
151
 *  discipline indicated in attribute_set.  The state set on
152
 *  threads which block on the_thread_queue is state.
153
 */
154
 
155
void _Thread_queue_Initialize(
156
  Thread_queue_Control         *the_thread_queue,
157
  Thread_queue_Disciplines      the_discipline,
158
  States_Control                state,
159
  unsigned32                    timeout_status
160
);
161
 
162
/*
163
 *  _Thread_queue_Dequeue_priority
164
 *
165
 *  DESCRIPTION:
166
 *
167
 *  This function returns a pointer to the highest priority
168
 *  thread waiting on the_thread_queue.  If no threads are waiting
169
 *  on the_thread_queue, then NULL is returned.
170
 */
171
 
172
Thread_Control *_Thread_queue_Dequeue_priority(
173
  Thread_queue_Control *the_thread_queue
174
);
175
 
176
/*
177
 *  _Thread_queue_Enqueue_priority
178
 *
179
 *  DESCRIPTION:
180
 *
181
 *  This routine enqueues the currently executing thread on
182
 *  the_thread_queue with an optional timeout using the
183
 *  priority discipline.
184
 */
185
 
186
void _Thread_queue_Enqueue_priority(
187
  Thread_queue_Control *the_thread_queue,
188
  Thread_Control       *the_thread,
189
  Watchdog_Interval     timeout
190
);
191
 
192
/*
193
 *  _Thread_queue_Extract_priority
194
 *
195
 *  DESCRIPTION:
196
 *
197
 *  This routine removes the_thread from the_thread_queue
198
 *  and cancels any timeouts associated with this blocking.
199
 */
200
 
201
void _Thread_queue_Extract_priority(
202
  Thread_queue_Control *the_thread_queue,
203
  Thread_Control       *the_thread
204
);
205
 
206
/*
207
 *  _Thread_queue_First_priority
208
 *
209
 *  DESCRIPTION:
210
 *
211
 *  This function returns a pointer to the "first" thread
212
 *  on the_thread_queue.  The "first" thread is the highest
213
 *  priority thread waiting on the_thread_queue.
214
 */
215
 
216
Thread_Control *_Thread_queue_First_priority(
217
  Thread_queue_Control *the_thread_queue
218
);
219
 
220
/*
221
 *  _Thread_queue_Dequeue_FIFO
222
 *
223
 *  DESCRIPTION:
224
 *
225
 *  This function returns a pointer to the thread which has
226
 *  been waiting the longest on  the_thread_queue.  If no
227
 *  threads are waiting on the_thread_queue, then NULL is returned.
228
 */
229
 
230
Thread_Control *_Thread_queue_Dequeue_fifo(
231
  Thread_queue_Control *the_thread_queue
232
);
233
 
234
/*
235
 *  _Thread_queue_Enqueue_FIFO
236
 *
237
 *  DESCRIPTION:
238
 *
239
 *  This routine enqueues the currently executing thread on
240
 *  the_thread_queue with an optional timeout using the
241
 *  FIFO discipline.
242
 */
243
 
244
void _Thread_queue_Enqueue_fifo(
245
  Thread_queue_Control *the_thread_queue,
246
  Thread_Control       *the_thread,
247
  Watchdog_Interval     timeout
248
);
249
 
250
/*
251
 *  _Thread_queue_Extract_FIFO
252
 *
253
 *  DESCRIPTION:
254
 *
255
 *  This routine removes the_thread from the_thread_queue
256
 *  and cancels any timeouts associated with this blocking.
257
 */
258
 
259
void _Thread_queue_Extract_fifo(
260
  Thread_queue_Control *the_thread_queue,
261
  Thread_Control       *the_thread
262
);
263
 
264
/*
265
 *  _Thread_queue_First_FIFO
266
 *
267
 *  DESCRIPTION:
268
 *
269
 *  This function returns a pointer to the "first" thread
270
 *  on the_thread_queue.  The first thread is the thread
271
 *  which has been waiting longest on the_thread_queue.
272
 */
273
 
274
Thread_Control *_Thread_queue_First_fifo(
275
  Thread_queue_Control *the_thread_queue
276
);
277
 
278
/*
279
 *  _Thread_queue_timeout
280
 *
281
 *  DESCRIPTION:
282
 *
283
 *  This routine is invoked when a task's request has not
284
 *  been satisfied after the timeout interval specified to
285
 *  enqueue.  The task represented by ID will be unblocked and
286
 *  its status code will be set in it's control block to indicate
287
 *  that a timeout has occurred.
288
 */
289
 
290
void _Thread_queue_Timeout (
291
  Objects_Id  id,
292
  void       *ignored
293
);
294
 
295
#ifdef __cplusplus
296
}
297
#endif
298
 
299
#endif
300
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.