diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-26 09:39:19 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-26 09:39:19 +0000 |
commit | f89cc618523e6a25a929727b9f9c63acba8a9e9b (patch) | |
tree | 7e2f7cbd0136adaee94fd2b3f48e6fb17ffc5241 /gcc/ada/s-tpoben.ads | |
parent | 4e888ff713661bf82ac200c8e0486b3d6c46ff3d (diff) | |
download | ppe42-gcc-f89cc618523e6a25a929727b9f9c63acba8a9e9b.tar.gz ppe42-gcc-f89cc618523e6a25a929727b9f9c63acba8a9e9b.zip |
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-tpoben.ads')
-rw-r--r-- | gcc/ada/s-tpoben.ads | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/gcc/ada/s-tpoben.ads b/gcc/ada/s-tpoben.ads index 9feba091396..b3dea7b03d2 100644 --- a/gcc/ada/s-tpoben.ads +++ b/gcc/ada/s-tpoben.ads @@ -113,7 +113,7 @@ package System.Tasking.Protected_Objects.Entries is Old_Base_Priority : System.Any_Priority; -- Task's base priority when the protected operation was called - Pending_Action : Boolean; + Pending_Action : Boolean; -- Flag indicating that priority has been dipped temporarily in order -- to avoid violating the priority ceiling of the lock associated with -- this protected object, in Lock_Server. The flag tells Unlock_Server @@ -132,11 +132,16 @@ package System.Tasking.Protected_Objects.Entries is -- Pointer to an array containing the executable code for all entry -- bodies of a protected type. - -- The following function maps the entry index in a call (which denotes - -- the queue to the proper entry) into the body of the entry. - Find_Body_Index : Find_Body_Index_Access; - Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries); + -- A function which maps the entry index in a call (which denotes the + -- queue of the proper entry) into the body of the entry. + + Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries); + + Entry_Names : Entry_Names_Array_Access := null; + -- An array of string names which denotes entry [family member] names. + -- The structure is indexed by protected entry index and contains Num_ + -- Entries components. end record; -- No default initial values for this type, since call records @@ -164,11 +169,12 @@ package System.Tasking.Protected_Objects.Entries is -- System.Tasking.Protected_Objects.Initialize_Protection. procedure Initialize_Protection_Entries - (Object : Protection_Entries_Access; - Ceiling_Priority : Integer; - Compiler_Info : System.Address; - Entry_Bodies : Protected_Entry_Body_Access; - Find_Body_Index : Find_Body_Index_Access); + (Object : Protection_Entries_Access; + Ceiling_Priority : Integer; + Compiler_Info : System.Address; + Entry_Bodies : Protected_Entry_Body_Access; + Find_Body_Index : Find_Body_Index_Access; + Build_Entry_Names : Boolean); -- Initialize the Object parameter so that it can be used by the runtime -- to keep track of the runtime state of a protected object. @@ -202,6 +208,13 @@ package System.Tasking.Protected_Objects.Entries is Prio : System.Any_Priority); -- Sets the new ceiling priority of the protected object + procedure Set_Entry_Name + (Object : Protection_Entries'Class; + Pos : Protected_Entry_Index; + Val : String_Access); + -- This is called by the compiler to map a string which denotes an entry + -- name to a protected entry index. + procedure Unlock_Entries (Object : Protection_Entries_Access); -- Relinquish ownership of the lock for the object represented by the -- Object parameter. If this ownership was for write access, or if it was |