1 ------------------------------------------------------------------------------
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
5 -- S Y S T E M . T A S K I N G . E N T R Y _ C A L L S --
10 -- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
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. --
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. --
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). --
33 ------------------------------------------------------------------------------
35 -- This package provides internal RTS calls implementing operations
36 -- that apply to general entry calls, that is, calls to either
37 -- protected or task entries.
39 -- These declarations are not part of the GNARL Interface
41 package System.Tasking.Entry_Calls is
43 procedure Wait_For_Completion (Entry_Call : Entry_Call_Link);
44 -- This procedure suspends the calling task until the specified entry
45 -- call has either been completed or cancelled. It performs other
46 -- operations required of suspended tasks, such as performing
47 -- dynamic priority changes. On exit, the call will not be queued.
48 -- This waits for calls on task or protected entries.
49 -- Abortion must be deferred when calling this procedure.
50 -- Call this only when holding Self (= Entry_Call.Self) or global RTS lock.
52 procedure Wait_For_Completion_With_Timeout
53 (Entry_Call : Entry_Call_Link;
54 Wakeup_Time : Duration;
56 Yielded : out Boolean);
57 -- Same as Wait_For_Completion but wait for a timeout with the value
58 -- specified in Wakeup_Time as well.
59 -- On return, Yielded indicates whether the wait has performed a yield.
60 -- Check_Exception must be called after calling this procedure.
62 procedure Wait_Until_Abortable
64 Call : Entry_Call_Link);
65 -- This procedure suspends the calling task until the specified entry
66 -- call is queued abortably or completes.
67 -- Abortion must be deferred when calling this procedure, and the global
68 -- RTS lock taken when Single_Lock.
70 procedure Try_To_Cancel_Entry_Call (Succeeded : out Boolean);
71 pragma Inline (Try_To_Cancel_Entry_Call);
72 -- Try to cancel async. entry call.
73 -- Effect includes Abort_To_Level and Wait_For_Completion.
74 -- Cancelled = True iff the cancelation was successful, i.e.,
75 -- the call was not Done before this call.
76 -- On return, the call is off-queue and the ATC level is reduced by one.
78 procedure Reset_Priority
80 Acceptor_Prev_Priority : Rendezvous_Priority);
81 pragma Inline (Reset_Priority);
82 -- Reset the priority of a task completing an accept statement to
83 -- the value it had before the call.
84 -- Acceptor should always be equal to Self.
86 procedure Check_Exception
88 Entry_Call : Entry_Call_Link);
89 pragma Inline (Check_Exception);
90 -- Raise any pending exception from the Entry_Call.
91 -- This should be called at the end of every compiler interface procedure
92 -- that implements an entry call.
93 -- In principle, the caller should not be abort-deferred (unless the
94 -- application program violates the Ada language rules by doing entry calls
95 -- from within protected operations -- an erroneous practice apparently
96 -- followed with success by some adventurous GNAT users).
97 -- Absolutely, the caller should not be holding any locks, or there
100 end System.Tasking.Entry_Calls;