FSF GCC merge 02/23/03
[official-gcc.git] / gcc / ada / s-tasque.ads
blobe7211add6b3c3bb8088bd663889355209229ef9d
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . T A S K I N G . Q U E U I N G --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
11 -- --
12 -- GNARL is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNARL; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNARL was developed by the GNARL team at Florida State University. It is --
31 -- now maintained by Ada Core Technologies, Inc. (http://www.gnat.com). --
32 -- --
33 ------------------------------------------------------------------------------
35 with System.Tasking.Protected_Objects.Entries;
37 package System.Tasking.Queuing is
39 package POE renames System.Tasking.Protected_Objects.Entries;
41 procedure Broadcast_Program_Error
42 (Self_ID : Task_ID;
43 Object : POE.Protection_Entries_Access;
44 Pending_Call : Entry_Call_Link;
45 RTS_Locked : Boolean := False);
46 -- Raise Program_Error in all tasks calling the protected entries of Object
47 -- The exception will not be raised immediately for the calling task; it
48 -- will be deferred until it calls Check_Exception.
49 -- RTS_Locked indicates whether the global RTS lock is taken (only
50 -- relevant if Single_Lock is True).
52 procedure Enqueue (E : in out Entry_Queue; Call : Entry_Call_Link);
53 -- Enqueue Call at the end of entry_queue E
55 procedure Dequeue (E : in out Entry_Queue; Call : Entry_Call_Link);
56 -- Dequeue Call from entry_queue E
58 function Head (E : in Entry_Queue) return Entry_Call_Link;
59 -- Return the head of entry_queue E
60 pragma Inline (Head);
62 procedure Dequeue_Head
63 (E : in out Entry_Queue;
64 Call : out Entry_Call_Link);
65 -- Remove and return the head of entry_queue E
67 function Onqueue (Call : Entry_Call_Link) return Boolean;
68 -- Return True if Call is on any entry_queue at all
69 pragma Inline (Onqueue);
71 function Count_Waiting (E : in Entry_Queue) return Natural;
72 -- Return number of calls on the waiting queue of E
74 procedure Select_Task_Entry_Call
75 (Acceptor : Task_ID;
76 Open_Accepts : Accept_List_Access;
77 Call : out Entry_Call_Link;
78 Selection : out Select_Index;
79 Open_Alternative : out Boolean);
80 -- Select an entry for rendezvous. On exit:
81 -- Call will contain a pointer to the entry call record selected;
82 -- Selection will contain the index of the alternative selected
83 -- Open_Alternative will be True if there were any open alternatives
85 procedure Select_Protected_Entry_Call
86 (Self_ID : Task_ID;
87 Object : POE.Protection_Entries_Access;
88 Call : out Entry_Call_Link);
89 -- Select an entry of a protected object
91 procedure Enqueue_Call (Entry_Call : Entry_Call_Link);
92 procedure Dequeue_Call (Entry_Call : Entry_Call_Link);
93 -- Enqueue (dequeue) the call to (from) whatever server they are
94 -- calling, whether a task or a protected object.
96 procedure Requeue_Call_With_New_Prio
97 (Entry_Call : Entry_Call_Link; Prio : System.Any_Priority);
98 -- Change Priority of the call and re insert to the queue when priority
99 -- queueing is in effect. When FIFO is inforced, this routine
100 -- should not have any effect.
102 end System.Tasking.Queuing;