source: rtems/c/src/exec/score/include/rtems/score/threadq.h @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was 7f6a24ab, checked in by Joel Sherrill <joel.sherrill@…>, on 08/28/95 at 15:30:29

Added unused priority ceiling parameter to rtems_semaphore_create.

Rearranged code to created thread handler routines to initialize,
start, restart, and "close/delete" a thread.

Made internal threads their own object class. This now uses the
thread support routines for starting and initializing a thread.

Insured deleted tasks are freed to the Inactive pool associated with the
correct Information block.

Added an RTEMS API specific data area to the thread control block.

Beginnings of removing the word "rtems" from the core.

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