summaryrefslogtreecommitdiff
path: root/gcc/ada/s-taskin.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-26 09:39:19 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-26 09:39:19 +0000
commitf89cc618523e6a25a929727b9f9c63acba8a9e9b (patch)
tree7e2f7cbd0136adaee94fd2b3f48e6fb17ffc5241 /gcc/ada/s-taskin.ads
parent4e888ff713661bf82ac200c8e0486b3d6c46ff3d (diff)
downloadgcc-f89cc618523e6a25a929727b9f9c63acba8a9e9b.tar.gz
2008-05-26 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch3.adb (Build_Init_Statements): Alphabetize local variables. Create the statements which map a string name to protected or task entry indix. * exp_ch9.adb: Add with and use clause for Stringt. Minor code reformatting. (Build_Entry_Names): New routine. (Make_Initialize_Protection, Make_Task_Create_Call): Generate a value for flag Build_Entry_Names which controls the allocation of the data structure for the string names of entries. * exp_ch9.ads (Build_Entry_Names): New subprogram. * exp_util.adb (Entry_Names_OK): New function. * exp_util.ads (Entry_Names_OK): New function. * rtsfind.ads: Add RO_PE_Set_Entry_Name and RO_TS_Set_Entry_Name to enumerations RE_Id and RE_Unit_Table. * s-taskin.adb Add with and use clause for Ada.Unchecked_Deallocation. (Free_Entry_Names_Array): New routine. * s-taskin.ads: Comment reformatting. Add types String_Access, Entry_Names_Array, Entry_Names_Array_Access. Add component Entry_Names to record Ada_Task_Control_Block. (Free_Entry_Names_Array): New routine. * s-tassta.adb (Create_Task): If flag Build_Entry_Names is set, dynamically allocate an array of string pointers. This structure holds string entry names. (Free_Entry_Names): New routine. (Free_Task, Vulnerable_Free_Task): Deallocate the entry names array. (Set_Entry_Names): New routine. * s-tassta.ads: (Create_Task): Add formal Build_Entry_Names. The flag is used to control the allocation of the data structure which stores entry names. (Set_Entry_Name): New routine. * s-tpoben.adb: Add with and use clause for Ada.Unchecked_Conversion. (Finalize): Deallocate the entry names array. (Free_Entry_Names): New routine. (Initialize_Protection_Entries): When flag Build_Entry_Names is set, create an array of string pointers to hold the entry names. (Set_Entry_Name): New routine. * s-tpoben.ads: Add field Entry_Names to record Protection_Entries. (Initialize_Protection_Entries): Add formal Build_Entry_Names. (Set_Entry_Name): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-taskin.ads')
-rw-r--r--gcc/ada/s-taskin.ads51
1 files changed, 33 insertions, 18 deletions
diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads
index 70e755da016..87afc802e54 100644
--- a/gcc/ada/s-taskin.ads
+++ b/gcc/ada/s-taskin.ads
@@ -237,6 +237,19 @@ package System.Tasking is
type Task_Entry_Queue_Array is
array (Task_Entry_Index range <>) of Entry_Queue;
+ -- A data structure which contains the string names of entries and entry
+ -- family members.
+
+ type String_Access is access all String;
+
+ type Entry_Names_Array is
+ array (Entry_Index range <>) of String_Access;
+
+ type Entry_Names_Array_Access is access all Entry_Names_Array;
+
+ procedure Free_Entry_Names_Array (Obj : in out Entry_Names_Array);
+ -- Deallocate all string names contained in an entry names array
+
----------------------------------
-- Entry_Call_Record definition --
----------------------------------
@@ -441,19 +454,17 @@ package System.Tasking is
-- and rendezvous.
--
-- Ada 95 notes: In Ada 95, this field will be transferred to the
- -- Priority field of an Entry_Calls component when an entry call
- -- is initiated. The Priority of the Entry_Calls component will not
- -- change for the duration of the call. The accepting task can
- -- use it to boost its own priority without fear of its changing in
- -- the meantime.
+ -- Priority field of an Entry_Calls component when an entry call is
+ -- initiated. The Priority of the Entry_Calls component will not change
+ -- for the duration of the call. The accepting task can use it to boost
+ -- its own priority without fear of its changing in the meantime.
--
- -- This can safely be used in the priority ordering
- -- of entry queues. Once a call is queued, its priority does not
- -- change.
+ -- This can safely be used in the priority ordering of entry queues.
+ -- Once a call is queued, its priority does not change.
--
- -- Since an entry call cannot be made while executing
- -- a protected action, the priority of a task will never reflect a
- -- priority ceiling change at the point of an entry call.
+ -- Since an entry call cannot be made while executing a protected
+ -- action, the priority of a task will never reflect a priority ceiling
+ -- change at the point of an entry call.
--
-- Protection: Only written by Self, and only accessed when Acceptor
-- accepts an entry or when Created activates, at which points Self is
@@ -467,8 +478,8 @@ package System.Tasking is
-- can be read/written from protected interrupt handlers.
Task_Image : String (1 .. System.Parameters.Max_Task_Image_Length);
- -- Hold a string that provides a readable id for task,
- -- built from the variable of which it is a value or component.
+ -- Hold a string that provides a readable id for task, built from the
+ -- variable of which it is a value or component.
Task_Image_Len : Natural;
-- Actual length of Task_Image
@@ -489,7 +500,7 @@ package System.Tasking is
Task_Arg : System.Address;
-- The argument to task procedure. Provide a handle for discriminant
- -- information
+ -- information.
--
-- Protection: Part of the synchronization between Self and Activator.
-- Activator writes it, once, before Self starts executing. Thereafter,
@@ -605,10 +616,9 @@ package System.Tasking is
-- Restricted_Ada_Task_Control_Block --
---------------------------------------
- -- This type should only be used by the restricted GNARLI and by
- -- restricted GNULL implementations to allocate an ATCB (see
- -- System.Task_Primitives.Operations.New_ATCB) that will take
- -- significantly less memory.
+ -- This type should only be used by the restricted GNARLI and by restricted
+ -- GNULL implementations to allocate an ATCB (see System.Task_Primitives.
+ -- Operations.New_ATCB) that will take significantly less memory.
-- Note that the restricted GNARLI should only access fields that are
-- present in the Restricted_Ada_Task_Control_Block structure.
@@ -855,6 +865,11 @@ package System.Tasking is
-- associated with protected objects or task entries, and are protected
-- by the protected object lock or Acceptor.L, respectively.
+ Entry_Names : Entry_Names_Array_Access := null;
+ -- An array of string names which denotes entry [family member] names.
+ -- The structure is indexed by task entry index and contains Entry_Num
+ -- components.
+
New_Base_Priority : System.Any_Priority;
-- New value for Base_Priority (for dynamic priorities package)
--