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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [include/] [rtems/] [score/] [threadq.h] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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
 *  $Id: threadq.h,v 1.2 2001-09-27 11:59:32 chris 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
typedef void ( *Thread_queue_Extract_callout )(
51
                 Thread_Control *
52
             );
53
 
54
SCORE_EXTERN Thread_queue_Extract_callout
55
  _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
56
 
57
/*
58
 *  _Thread_queue_Dequeue
59
 *
60
 *  DESCRIPTION:
61
 *
62
 *  This function returns a pointer to a thread waiting on
63
 *  the_thread_queue.  The selection of this thread is based on
64
 *  the discipline of the_thread_queue.  If no threads are waiting
65
 *  on the_thread_queue, then NULL is returned.
66
 */
67
 
68
Thread_Control *_Thread_queue_Dequeue(
69
  Thread_queue_Control *the_thread_queue
70
);
71
 
72
/*
73
 *  _Thread_queue_Enqueue
74
 *
75
 *  DESCRIPTION:
76
 *
77
 *  This routine enqueues the currently executing thread on
78
 *  the_thread_queue with an optional timeout.
79
 */
80
 
81
void _Thread_queue_Enqueue(
82
  Thread_queue_Control *the_thread_queue,
83
  Watchdog_Interval     timeout
84
);
85
 
86
/*
87
 *  _Thread_queue_Extract
88
 *
89
 *  DESCRIPTION:
90
 *
91
 *  This routine removes the_thread from the_thread_queue
92
 *  and cancels any timeouts associated with this blocking.
93
 */
94
 
95
void _Thread_queue_Extract(
96
  Thread_queue_Control *the_thread_queue,
97
  Thread_Control       *the_thread
98
);
99
 
100
/*
101
 *  _Thread_queue_Extract_with_proxy
102
 *
103
 *  DESCRIPTION:
104
 *
105
 *  This routine extracts the_thread from the_thread_queue
106
 *  and insures that if there is a proxy for this task on
107
 *  another node, it is also dealt with.
108
 */
109
 
110
boolean _Thread_queue_Extract_with_proxy(
111
  Thread_Control       *the_thread
112
);
113
 
114
/*
115
 *  _Thread_queue_First
116
 *
117
 *  DESCRIPTION:
118
 *
119
 *  This function returns a pointer to the "first" thread
120
 *  on the_thread_queue.  The "first" thread is selected
121
 *  based on the discipline of the_thread_queue.
122
 */
123
 
124
Thread_Control *_Thread_queue_First(
125
  Thread_queue_Control *the_thread_queue
126
);
127
 
128
/*
129
 *  _Thread_queue_Flush
130
 *
131
 *  DESCRIPTION:
132
 *
133
 *  This routine unblocks all threads blocked on the_thread_queue
134
 *  and cancels any associated timeouts.
135
 */
136
 
137
void _Thread_queue_Flush(
138
  Thread_queue_Control       *the_thread_queue,
139
  Thread_queue_Flush_callout  remote_extract_callout,
140
  unsigned32                  status
141
);
142
 
143
/*
144
 *  _Thread_queue_Initialize
145
 *
146
 *  DESCRIPTION:
147
 *
148
 *  This routine initializes the_thread_queue based on the
149
 *  discipline indicated in attribute_set.  The state set on
150
 *  threads which block on the_thread_queue is state.
151
 */
152
 
153
void _Thread_queue_Initialize(
154
  Thread_queue_Control         *the_thread_queue,
155
  Objects_Classes               the_class,
156
  Thread_queue_Disciplines      the_discipline,
157
  States_Control                state,
158
  Thread_queue_Extract_callout  proxy_extract_callout,
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.