source: rtems/cpukit/score/include/rtems/score/threadq.h @ 092f142a

4.104.114.84.95
Last change on this file since 092f142a was 092f142a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/28/05 at 05:00:21

New header guard.

  • Property mode set to 100644
File size: 6.1 KB
Line 
1/**
2 *  @file  rtems/score/threadq.h
3 *
4 *  This include file contains all the constants and structures associated
5 *  with the manipulation of objects.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2004.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef _RTEMS_SCORE_THREADQ_H
20#define _RTEMS_SCORE_THREADQ_H
21
22/**
23 *  @defgroup ScoreThreadQ Thread Queue Handler
24 *
25 *  This group contains functionality which XXX
26 */
27/**@{*/
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <rtems/score/tqdata.h>
34
35#include <rtems/score/object.h>
36#include <rtems/score/thread.h>
37#include <rtems/score/watchdog.h>
38
39/**
40 *  Constant for indefinite wait.
41 */
42#define THREAD_QUEUE_WAIT_FOREVER  WATCHDOG_NO_TIMEOUT
43
44/**
45 *  The following type defines the callout used when a remote task
46 *  is extracted from a local thread queue.
47 */
48typedef void ( *Thread_queue_Flush_callout )(
49                 Thread_Control *
50             );
51
52/** @brief  Thread queue Dequeue
53 *
54 *  This function returns a pointer to a thread waiting on
55 *  the_thread_queue.  The selection of this thread is based on
56 *  the discipline of the_thread_queue.  If no threads are waiting
57 *  on the_thread_queue, then NULL is returned.
58 */
59Thread_Control *_Thread_queue_Dequeue(
60  Thread_queue_Control *the_thread_queue
61);
62
63/** @brief  Thread queue Enqueue
64 *
65 *  This routine enqueues the currently executing thread on
66 *  the_thread_queue with an optional timeout.
67 */
68void _Thread_queue_Enqueue(
69  Thread_queue_Control *the_thread_queue,
70  Watchdog_Interval     timeout
71);
72
73/** @brief  Thread queue Extract
74 *
75 *  This routine removes the_thread from the_thread_queue
76 *  and cancels any timeouts associated with this blocking.
77 */
78void _Thread_queue_Extract(
79  Thread_queue_Control *the_thread_queue,
80  Thread_Control       *the_thread
81);
82
83/** @brief  Thread queue Extract with proxy
84 *
85 *  This routine extracts the_thread from the_thread_queue
86 *  and ensures that if there is a proxy for this task on
87 *  another node, it is also dealt with.
88 */
89boolean _Thread_queue_Extract_with_proxy(
90  Thread_Control       *the_thread
91);
92
93/** @brief  Thread queue First
94 *
95 *  This function returns a pointer to the "first" thread
96 *  on the_thread_queue.  The "first" thread is selected
97 *  based on the discipline of the_thread_queue.
98 */
99Thread_Control *_Thread_queue_First(
100  Thread_queue_Control *the_thread_queue
101);
102
103/** @brief  Thread queue Flush
104 *
105 *  This routine unblocks all threads blocked on the_thread_queue
106 *  and cancels any associated timeouts.
107 */
108void _Thread_queue_Flush(
109  Thread_queue_Control       *the_thread_queue,
110  Thread_queue_Flush_callout  remote_extract_callout,
111  uint32_t                    status
112);
113
114/** @brief  Thread queue Initialize
115 *
116 *  This routine initializes the_thread_queue based on the
117 *  discipline indicated in attribute_set.  The state set on
118 *  threads which block on the_thread_queue is state.
119 */
120void _Thread_queue_Initialize(
121  Thread_queue_Control         *the_thread_queue,
122  Thread_queue_Disciplines      the_discipline,
123  States_Control                state,
124  uint32_t                      timeout_status
125);
126
127/** @brief  Thread queue Dequeue priority
128 *
129 *  This function returns a pointer to the highest priority
130 *  thread waiting on the_thread_queue.  If no threads are waiting
131 *  on the_thread_queue, then NULL is returned.
132 */
133Thread_Control *_Thread_queue_Dequeue_priority(
134  Thread_queue_Control *the_thread_queue
135);
136
137/** @brief  Thread queue Enqueue priority
138 *
139 *  This routine enqueues the currently executing thread on
140 *  the_thread_queue with an optional timeout using the
141 *  priority discipline.
142 */
143void _Thread_queue_Enqueue_priority(
144  Thread_queue_Control *the_thread_queue,
145  Thread_Control       *the_thread,
146  Watchdog_Interval     timeout
147);
148
149/** @brief  Thread queue Extract priority
150 *
151 *  This routine removes the_thread from the_thread_queue
152 *  and cancels any timeouts associated with this blocking.
153 */
154void _Thread_queue_Extract_priority(
155  Thread_queue_Control *the_thread_queue,
156  Thread_Control       *the_thread
157);
158
159/** @brief  Thread queue First priority
160 *
161 *  This function returns a pointer to the "first" thread
162 *  on the_thread_queue.  The "first" thread is the highest
163 *  priority thread waiting on the_thread_queue.
164 */
165Thread_Control *_Thread_queue_First_priority(
166  Thread_queue_Control *the_thread_queue
167);
168
169/** @brief  Thread queue Dequeue FIFO
170 *
171 *  This function returns a pointer to the thread which has
172 *  been waiting the longest on  the_thread_queue.  If no
173 *  threads are waiting on the_thread_queue, then NULL is returned.
174 */
175Thread_Control *_Thread_queue_Dequeue_fifo(
176  Thread_queue_Control *the_thread_queue
177);
178
179/** @brief  Thread queue Enqueue FIFO
180 *
181 *  This routine enqueues the currently executing thread on
182 *  the_thread_queue with an optional timeout using the
183 *  FIFO discipline.
184 */
185void _Thread_queue_Enqueue_fifo(
186  Thread_queue_Control *the_thread_queue,
187  Thread_Control       *the_thread,
188  Watchdog_Interval     timeout
189);
190
191/** @brief  Thread queue Extract FIFO
192 *
193 *  This routine removes the_thread from the_thread_queue
194 *  and cancels any timeouts associated with this blocking.
195 */
196void _Thread_queue_Extract_fifo(
197  Thread_queue_Control *the_thread_queue,
198  Thread_Control       *the_thread
199);
200
201/** @brief  Thread queue First FIFO
202 *
203 *  This function returns a pointer to the "first" thread
204 *  on the_thread_queue.  The first thread is the thread
205 *  which has been waiting longest on the_thread_queue.
206 */
207Thread_Control *_Thread_queue_First_fifo(
208  Thread_queue_Control *the_thread_queue
209);
210
211/** @brief  Thread queue timeout
212 *
213 *  This routine is invoked when a task's request has not
214 *  been satisfied after the timeout interval specified to
215 *  enqueue.  The task represented by ID will be unblocked and
216 *  its status code will be set in it's control block to indicate
217 *  that a timeout has occurred.
218 */
219void _Thread_queue_Timeout (
220  Objects_Id  id,
221  void       *ignored
222);
223
224#ifdef __cplusplus
225}
226#endif
227
228/**@}*/
229
230#endif
231/* end of include file */
Note: See TracBrowser for help on using the repository browser.