annotate gcc/ada/libgnarl/s-tasinf.ads @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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 COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S Y S T E M . T A S K _ I N F O --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT 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 -- GNAT was originally developed by the GNAT team at New York 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 contains the definitions and routines associated with the
kono
parents:
diff changeset
33 -- implementation and use of the Task_Info pragma. It is specialized
kono
parents:
diff changeset
34 -- appropriately for targets that make use of this pragma.
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- Note: the compiler generates direct calls to this interface, via Rtsfind.
kono
parents:
diff changeset
37 -- Any changes to this interface may require corresponding compiler changes.
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 -- The functionality in this unit is now provided by the predefined package
kono
parents:
diff changeset
40 -- System.Multiprocessors and the CPU aspect. This package is obsolescent.
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 package System.Task_Info is
kono
parents:
diff changeset
43 pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
kono
parents:
diff changeset
44 pragma Preelaborate;
kono
parents:
diff changeset
45 pragma Elaborate_Body;
kono
parents:
diff changeset
46 -- To ensure that a body is allowed
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 -----------------------------------------
kono
parents:
diff changeset
49 -- Implementation of Task_Info Feature --
kono
parents:
diff changeset
50 -----------------------------------------
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 -- The Task_Info pragma:
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 -- pragma Task_Info (EXPRESSION);
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 -- allows the specification on a task by task basis of a value of type
kono
parents:
diff changeset
57 -- System.Task_Info.Task_Info_Type to be passed to a task when it is
kono
parents:
diff changeset
58 -- created. The specification of this type, and the effect on the task
kono
parents:
diff changeset
59 -- that is created is target dependent.
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 -- The Task_Info pragma appears within a task definition (compare the
kono
parents:
diff changeset
62 -- definition and implementation of pragma Priority). If no such pragma
kono
parents:
diff changeset
63 -- appears, then the value Unspecified_Task_Info is passed. If a pragma
kono
parents:
diff changeset
64 -- is present, then it supplies an alternative value. If the argument of
kono
parents:
diff changeset
65 -- the pragma is a discriminant reference, then the value can be set on
kono
parents:
diff changeset
66 -- a task by task basis by supplying the appropriate discriminant value.
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 -- Note that this means that the type used for Task_Info_Type must be
kono
parents:
diff changeset
69 -- suitable for use as a discriminant (i.e. a scalar or access type).
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 ------------------
kono
parents:
diff changeset
72 -- Declarations --
kono
parents:
diff changeset
73 ------------------
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 type Scope_Type is
kono
parents:
diff changeset
76 (Process_Scope,
kono
parents:
diff changeset
77 -- Contend only with threads in same process
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 System_Scope,
kono
parents:
diff changeset
80 -- Contend with all threads on same CPU
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 Default_Scope);
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 type Task_Info_Type is new Scope_Type;
kono
parents:
diff changeset
85 -- Type used for passing information to task create call, using the
kono
parents:
diff changeset
86 -- Task_Info pragma. This type may be specialized for individual
kono
parents:
diff changeset
87 -- implementations, but it must be a type that can be used as a
kono
parents:
diff changeset
88 -- discriminant (i.e. a scalar or access type).
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 Unspecified_Task_Info : constant Task_Info_Type := Default_Scope;
kono
parents:
diff changeset
91 -- Value passed to task in the absence of a Task_Info pragma
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 end System.Task_Info;