Merge from mainline
[official-gcc.git] / gcc / ada / s-tasque.ads
blobd8a23a04aad3671f238c2a5f235cda5c0e425271
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT 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 -- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
10 -- --
11 -- GNARL is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNARL; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNARL was developed by the GNARL team at Florida State University. --
30 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 with System.Tasking.Protected_Objects.Entries;
36 package System.Tasking.Queuing is
38 package POE renames System.Tasking.Protected_Objects.Entries;
40 procedure Broadcast_Program_Error
41 (Self_ID : Task_Id;
42 Object : POE.Protection_Entries_Access;
43 Pending_Call : Entry_Call_Link;
44 RTS_Locked : Boolean := False);
45 -- Raise Program_Error in all tasks calling the protected entries of Object
46 -- The exception will not be raised immediately for the calling task; it
47 -- will be deferred until it calls Check_Exception.
48 -- RTS_Locked indicates whether the global RTS lock is taken (only
49 -- relevant if Single_Lock is True).
51 procedure Enqueue (E : in out Entry_Queue; Call : Entry_Call_Link);
52 -- Enqueue Call at the end of entry_queue E
54 procedure Dequeue (E : in out Entry_Queue; Call : Entry_Call_Link);
55 -- Dequeue Call from entry_queue E
57 function Head (E : Entry_Queue) return Entry_Call_Link;
58 pragma Inline (Head);
59 -- Return the head of entry_queue E
61 procedure Dequeue_Head
62 (E : in out Entry_Queue;
63 Call : out Entry_Call_Link);
64 -- Remove and return the head of entry_queue E
66 function Onqueue (Call : Entry_Call_Link) return Boolean;
67 pragma Inline (Onqueue);
68 -- Return True if Call is on any entry_queue at all
70 function Count_Waiting (E : Entry_Queue) return Natural;
71 -- Return number of calls on the waiting queue of E
73 procedure Select_Task_Entry_Call
74 (Acceptor : Task_Id;
75 Open_Accepts : Accept_List_Access;
76 Call : out Entry_Call_Link;
77 Selection : out Select_Index;
78 Open_Alternative : out Boolean);
79 -- Select an entry for rendezvous. On exit:
80 -- Call will contain a pointer to the entry call record selected;
81 -- Selection will contain the index of the alternative selected
82 -- Open_Alternative will be True if there were any open alternatives
84 procedure Select_Protected_Entry_Call
85 (Self_ID : Task_Id;
86 Object : POE.Protection_Entries_Access;
87 Call : out Entry_Call_Link);
88 -- Select an entry of a protected object
90 procedure Enqueue_Call (Entry_Call : Entry_Call_Link);
91 procedure Dequeue_Call (Entry_Call : Entry_Call_Link);
92 -- Enqueue (dequeue) the call to (from) whatever server they are
93 -- calling, whether a task or a protected object.
95 procedure Requeue_Call_With_New_Prio
96 (Entry_Call : Entry_Call_Link; Prio : System.Any_Priority);
97 -- Change Priority of the call and re insert to the queue when priority
98 -- queueing is in effect. When FIFO is inforced, this routine
99 -- should not have any effect.
101 end System.Tasking.Queuing;