annotate gcc/ada/libgnarl/s-taenca.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S Y S T E M . T A S K I N G . E N T R Y _ C A L L S --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNARL is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
17 -- --
kono
parents:
diff changeset
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
19 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
20 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
23 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
25 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
26 -- --
kono
parents:
diff changeset
27 -- GNARL was developed by the GNARL team at Florida State University. --
kono
parents:
diff changeset
28 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
kono
parents:
diff changeset
29 -- --
kono
parents:
diff changeset
30 ------------------------------------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -- This package provides internal RTS calls implementing operations
kono
parents:
diff changeset
33 -- that apply to general entry calls, that is, calls to either
kono
parents:
diff changeset
34 -- protected or task entries.
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- These declarations are not part of the GNARL Interface
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 package System.Tasking.Entry_Calls is
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 procedure Wait_For_Completion (Entry_Call : Entry_Call_Link);
kono
parents:
diff changeset
41 -- This procedure suspends the calling task until the specified entry
kono
parents:
diff changeset
42 -- call has either been completed or cancelled. It performs other
kono
parents:
diff changeset
43 -- operations required of suspended tasks, such as performing
kono
parents:
diff changeset
44 -- dynamic priority changes. On exit, the call will not be queued.
kono
parents:
diff changeset
45 -- This waits for calls on task or protected entries.
kono
parents:
diff changeset
46 -- Abortion must be deferred when calling this procedure.
kono
parents:
diff changeset
47 -- Call this only when holding Self (= Entry_Call.Self) or global RTS lock.
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 procedure Wait_For_Completion_With_Timeout
kono
parents:
diff changeset
50 (Entry_Call : Entry_Call_Link;
kono
parents:
diff changeset
51 Wakeup_Time : Duration;
kono
parents:
diff changeset
52 Mode : Delay_Modes;
kono
parents:
diff changeset
53 Yielded : out Boolean);
kono
parents:
diff changeset
54 -- Same as Wait_For_Completion but wait for a timeout with the value
kono
parents:
diff changeset
55 -- specified in Wakeup_Time as well.
kono
parents:
diff changeset
56 -- On return, Yielded indicates whether the wait has performed a yield.
kono
parents:
diff changeset
57 -- Check_Exception must be called after calling this procedure.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure Wait_Until_Abortable
kono
parents:
diff changeset
60 (Self_ID : Task_Id;
kono
parents:
diff changeset
61 Call : Entry_Call_Link);
kono
parents:
diff changeset
62 -- This procedure suspends the calling task until the specified entry
kono
parents:
diff changeset
63 -- call is queued abortably or completes.
kono
parents:
diff changeset
64 -- Abortion must be deferred when calling this procedure, and the global
kono
parents:
diff changeset
65 -- RTS lock taken when Single_Lock.
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 procedure Try_To_Cancel_Entry_Call (Succeeded : out Boolean);
kono
parents:
diff changeset
68 pragma Inline (Try_To_Cancel_Entry_Call);
kono
parents:
diff changeset
69 -- Try to cancel async. entry call.
kono
parents:
diff changeset
70 -- Effect includes Abort_To_Level and Wait_For_Completion.
kono
parents:
diff changeset
71 -- Cancelled = True iff the cancellation was successful, i.e.,
kono
parents:
diff changeset
72 -- the call was not Done before this call.
kono
parents:
diff changeset
73 -- On return, the call is off-queue and the ATC level is reduced by one.
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 procedure Reset_Priority
kono
parents:
diff changeset
76 (Acceptor : Task_Id;
kono
parents:
diff changeset
77 Acceptor_Prev_Priority : Rendezvous_Priority);
kono
parents:
diff changeset
78 pragma Inline (Reset_Priority);
kono
parents:
diff changeset
79 -- Reset the priority of a task completing an accept statement to
kono
parents:
diff changeset
80 -- the value it had before the call.
kono
parents:
diff changeset
81 -- Acceptor should always be equal to Self.
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 procedure Check_Exception
kono
parents:
diff changeset
84 (Self_ID : Task_Id;
kono
parents:
diff changeset
85 Entry_Call : Entry_Call_Link);
kono
parents:
diff changeset
86 pragma Inline (Check_Exception);
kono
parents:
diff changeset
87 -- Raise any pending exception from the Entry_Call.
kono
parents:
diff changeset
88 -- This should be called at the end of every compiler interface procedure
kono
parents:
diff changeset
89 -- that implements an entry call.
kono
parents:
diff changeset
90 -- In principle, the caller should not be abort-deferred (unless the
kono
parents:
diff changeset
91 -- application program violates the Ada language rules by doing entry calls
kono
parents:
diff changeset
92 -- from within protected operations -- an erroneous practice apparently
kono
parents:
diff changeset
93 -- followed with success by some adventurous GNAT users).
kono
parents:
diff changeset
94 -- Absolutely, the caller should not be holding any locks, or there
kono
parents:
diff changeset
95 -- will be deadlock.
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 end System.Tasking.Entry_Calls;