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 --
9 -- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
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. --
29 -- GNARL was developed by the GNARL team at Florida State University. --
30 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
32 ------------------------------------------------------------------------------
34 -- This package provides internal RTS calls implementing operations
35 -- that apply to general entry calls, that is, calls to either
36 -- protected or task entries.
38 -- These declarations are not part of the GNARL Interface
40 package System
.Tasking
.Entry_Calls
is
42 procedure Wait_For_Completion
(Entry_Call
: Entry_Call_Link
);
43 -- This procedure suspends the calling task until the specified entry
44 -- call has either been completed or cancelled. It performs other
45 -- operations required of suspended tasks, such as performing
46 -- dynamic priority changes. On exit, the call will not be queued.
47 -- This waits for calls on task or protected entries.
48 -- Abortion must be deferred when calling this procedure.
49 -- Call this only when holding Self (= Entry_Call.Self) or global RTS lock.
51 procedure Wait_For_Completion_With_Timeout
52 (Entry_Call
: Entry_Call_Link
;
53 Wakeup_Time
: Duration;
55 Yielded
: out Boolean);
56 -- Same as Wait_For_Completion but wait for a timeout with the value
57 -- specified in Wakeup_Time as well.
58 -- On return, Yielded indicates whether the wait has performed a yield.
59 -- Check_Exception must be called after calling this procedure.
61 procedure Wait_Until_Abortable
63 Call
: Entry_Call_Link
);
64 -- This procedure suspends the calling task until the specified entry
65 -- call is queued abortably or completes.
66 -- Abortion must be deferred when calling this procedure, and the global
67 -- RTS lock taken when Single_Lock.
69 procedure Try_To_Cancel_Entry_Call
(Succeeded
: out Boolean);
70 pragma Inline
(Try_To_Cancel_Entry_Call
);
71 -- Try to cancel async. entry call.
72 -- Effect includes Abort_To_Level and Wait_For_Completion.
73 -- Cancelled = True iff the cancelation was successful, i.e.,
74 -- the call was not Done before this call.
75 -- On return, the call is off-queue and the ATC level is reduced by one.
77 procedure Reset_Priority
79 Acceptor_Prev_Priority
: Rendezvous_Priority
);
80 pragma Inline
(Reset_Priority
);
81 -- Reset the priority of a task completing an accept statement to
82 -- the value it had before the call.
83 -- Acceptor should always be equal to Self.
85 procedure Check_Exception
87 Entry_Call
: Entry_Call_Link
);
88 pragma Inline
(Check_Exception
);
89 -- Raise any pending exception from the Entry_Call.
90 -- This should be called at the end of every compiler interface procedure
91 -- that implements an entry call.
92 -- In principle, the caller should not be abort-deferred (unless the
93 -- application program violates the Ada language rules by doing entry calls
94 -- from within protected operations -- an erroneous practice apparently
95 -- followed with success by some adventurous GNAT users).
96 -- Absolutely, the caller should not be holding any locks, or there
99 end System
.Tasking
.Entry_Calls
;