2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / ada / s-tasinf.ads
blob18b6ce6c3f37f170da77f304185a060ca5199ce7
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S Y S T E M . T A S K _ I N F O --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
10 -- --
11 -- GNAT 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. GNAT 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 GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, 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 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package contains the definitions and routines associated with the
35 -- implementation and use of the Task_Info pragma. It is specialized
36 -- appropriately for targets that make use of this pragma.
38 -- Note: the compiler generates direct calls to this interface, via Rtsfind.
39 -- Any changes to this interface may require corresponding compiler changes.
41 -- This unit may be used directly from an application program by providing
42 -- an appropriate WITH, and the interface can be expected to remain stable.
44 package System.Task_Info is
45 pragma Elaborate_Body;
46 -- To ensure that a body is allowed
48 -----------------------------------------
49 -- Implementation of Task_Info Feature --
50 -----------------------------------------
52 -- The Task_Info pragma:
54 -- pragma Task_Info (EXPRESSION);
56 -- allows the specification on a task by task basis of a value of type
57 -- System.Task_Info.Task_Info_Type to be passed to a task when it is
58 -- created. The specification of this type, and the effect on the task
59 -- that is created is target dependent.
61 -- The Task_Info pragma appears within a task definition (compare the
62 -- definition and implementation of pragma Priority). If no such pragma
63 -- appears, then the value Task_Info_Unspecified is passed. If a pragma
64 -- is present, then it supplies an alternative value. If the argument of
65 -- the pragma is a discriminant reference, then the value can be set on
66 -- a task by task basis by supplying the appropriate discriminant value.
68 -- Note that this means that the type used for Task_Info_Type must be
69 -- suitable for use as a discriminant (i.e. a scalar or access type).
71 ------------------
72 -- Declarations --
73 ------------------
75 type Scope_Type is
76 (Process_Scope,
77 -- Contend only with threads in same process
79 System_Scope,
80 -- Contend with all threads on same CPU
82 Default_Scope);
84 type Task_Info_Type is new Scope_Type;
85 -- Type used for passing information to task create call, using the
86 -- Task_Info pragma. This type may be specialized for individual
87 -- implementations, but it must be a type that can be used as a
88 -- discriminant (i.e. a scalar or access type).
90 Unspecified_Task_Info : constant Task_Info_Type := Default_Scope;
91 -- Value passed to task in the absence of a Task_Info pragma
93 end System.Task_Info;