aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-tpoben.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-10-29 12:09:46 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-29 12:09:46 +0100
commitb9820f7b84d491adfec2f56f5ef58702510cd9e1 (patch)
treec6f72c04618eb46b19778035ec894212166d8ea2 /gcc/ada/s-tpoben.adb
parent8d9ef58eb842796ac219ad123d0a55efabf64131 (diff)
downloadgcc-b9820f7b84d491adfec2f56f5ef58702510cd9e1.zip
gcc-b9820f7b84d491adfec2f56f5ef58702510cd9e1.tar.gz
gcc-b9820f7b84d491adfec2f56f5ef58702510cd9e1.tar.bz2
[multiple changes]
2012-10-29 Tristan Gingold <gingold@adacore.com> * gnat_rm.texi: Document implementation advice for Pragma Partition_Elaboration_Policy. 2012-10-29 Yannick Moy <moy@adacore.com> * s-bignum.adb (Div_Rem): Reference that Algorithm_D is from the second edition of TAOCP from Knuth, since the algo changed in the third edition. Also correct the definition of 'd' which could overflow. 2012-10-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch3.adb (Build_Initialization_Call): Create static strings which denote entry [family] names and associate them with the object's Protection_Entries or ATCB. (Build_Init_Statements): Remove local variable Names. Do not generate the entry [family] names inside the init proc because they are now static. * exp_ch9.adb (Build_Entry_Names): Reimplemented. The strings which denote entry [family] names are now generated statically and associated with the concurrent object's Protection_Entries or ATCB during initialization. * exp_ch9.ads (Build_Entry_Names): Change subprogram profile and associated comment on usage. * rtsfind.ads: Add the following entries to tables RE_Id and RE_Unit_Table: RE_Protected_Entry_Names_Array RE_Task_Entry_Names_Array RO_PE_Number_Of_Entries RO_PE_Set_Entry_Names RO_ST_Number_Of_Entries RO_ST_Set_Entry_Names Remove the following entries from tables RE_Id and RE_Unit_Table: RO_PE_Set_Entry_Name RO_TS_Set_Entry_Name * s-taskin.adb: Remove with clause for Ada.Unchecked_Deallocation. (Free_Entry_Names_Array): Removed. (Number_Of_Entries): New routine. (Set_Entry_Names): New routine. * s-taskin.ads: Rename type Entry_Names_Array to Task_Entry_Names_Array. Rename type Entry_Names_Array_Access to Task_Entry_Names_Access. Update the type of ACTB field Entry_Names and add a comment on its protection status. (Free_Entry_Names_Array): Removed. (Number_Of_Entries): New routine. (Set_Entry_Names): New routine. * s-tassta.adb (Create_Task): Remove formal parameter Build_Entry_Names. Do not allocate an array to hold the string names of entries and families. (Free_Entry_Names): Removed. (Free_Task): Remove the call to Free_Entry_Names. (Set_Entry_Name): Removed. (Vulnerable_Free_Task): Remove the call to Free_Entry_Names. * s-tassta.ads (Create_Task): Remove formal parameter Build_Entry_Names along with associated comment. (Set_Entry_Name): Removed. * s-tpoben.adb: Remove with clause for Ada.Unchecked_Deallocation. (Finalize): Remove the call to Free_Entry_Names. (Free_Entry_Names): Removed. (Initialize_Protection_Entries): Remove formal parameter Build_Entry_Names. Do not allocate an array to hold the string names of entries and families. (Number_Of_Entries): New routine. (Set_Entry_Name): Removed. (Set_Entry_Names): New routine. * s-tpoben.ads: Add types Protected_Entry_Names_Array and Protected_Entry_Names_Access. Update the type of Protection_Enties field Entry_Names. (Initialize_Protection_Entries): Remove formal parameter Build_Entry_Names along with associated comment. (Number_Of_Entries): New routine. (Set_Entry_Name): Removed. (Set_Entry_Names): New routine. 2012-10-29 Arnaud Charlet <charlet@adacore.com> * gnat_ugn.texi: Minor typo fix. From-SVN: r192933
Diffstat (limited to 'gcc/ada/s-tpoben.adb')
-rw-r--r--gcc/ada/s-tpoben.adb79
1 files changed, 25 insertions, 54 deletions
diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb
index 8852731..f535a06 100644
--- a/gcc/ada/s-tpoben.adb
+++ b/gcc/ada/s-tpoben.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2012, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -41,8 +41,6 @@
-- Note: the compiler generates direct calls to this interface, via Rtsfind
-with Ada.Unchecked_Deallocation;
-
with System.Task_Primitives.Operations;
with System.Restrictions;
with System.Parameters;
@@ -58,13 +56,6 @@ package body System.Tasking.Protected_Objects.Entries is
use Parameters;
use Task_Primitives.Operations;
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- procedure Free_Entry_Names (Object : Protection_Entries);
- -- Deallocate all string names associated with protected entries
-
----------------
-- Local Data --
----------------
@@ -141,8 +132,6 @@ package body System.Tasking.Protected_Objects.Entries is
end loop;
end loop;
- Free_Entry_Names (Object);
-
Object.Finalized := True;
if Single_Lock then
@@ -154,26 +143,6 @@ package body System.Tasking.Protected_Objects.Entries is
STPO.Finalize_Lock (Object.L'Unrestricted_Access);
end Finalize;
- ----------------------
- -- Free_Entry_Names --
- ----------------------
-
- procedure Free_Entry_Names (Object : Protection_Entries) is
- Names : Entry_Names_Array_Access := Object.Entry_Names;
-
- procedure Free_Entry_Names_Array_Access is new
- Ada.Unchecked_Deallocation
- (Entry_Names_Array, Entry_Names_Array_Access);
-
- begin
- if Names = null then
- return;
- end if;
-
- Free_Entry_Names_Array (Names.all);
- Free_Entry_Names_Array_Access (Names);
- end Free_Entry_Names;
-
-----------------
-- Get_Ceiling --
-----------------
@@ -202,12 +171,11 @@ package body System.Tasking.Protected_Objects.Entries is
-----------------------------------
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;
- Build_Entry_Names : Boolean)
+ (Object : Protection_Entries_Access;
+ Ceiling_Priority : Integer;
+ Compiler_Info : System.Address;
+ Entry_Bodies : Protected_Entry_Body_Access;
+ Find_Body_Index : Find_Body_Index_Access)
is
Init_Priority : Integer := Ceiling_Priority;
Self_ID : constant Task_Id := STPO.Self;
@@ -250,11 +218,6 @@ package body System.Tasking.Protected_Objects.Entries is
Object.Entry_Queues (E).Head := null;
Object.Entry_Queues (E).Tail := null;
end loop;
-
- if Build_Entry_Names then
- Object.Entry_Names :=
- new Entry_Names_Array (1 .. Entry_Index (Object.Num_Entries));
- end if;
end Initialize_Protection_Entries;
------------------
@@ -391,6 +354,17 @@ package body System.Tasking.Protected_Objects.Entries is
end if;
end Lock_Read_Only_Entries;
+ -----------------------
+ -- Number_Of_Entries --
+ -----------------------
+
+ function Number_Of_Entries
+ (Object : Protection_Entries_Access) return Protected_Entry_Index
+ is
+ begin
+ return Object.Num_Entries;
+ end Number_Of_Entries;
+
-----------------
-- Set_Ceiling --
-----------------
@@ -402,20 +376,17 @@ package body System.Tasking.Protected_Objects.Entries is
Object.New_Ceiling := Prio;
end Set_Ceiling;
- --------------------
- -- Set_Entry_Name --
- --------------------
+ ---------------------
+ -- Set_Entry_Names --
+ ---------------------
- procedure Set_Entry_Name
- (Object : Protection_Entries'Class;
- Pos : Protected_Entry_Index;
- Val : String_Access)
+ procedure Set_Entry_Names
+ (Object : Protection_Entries_Access;
+ Names : Protected_Entry_Names_Access)
is
begin
- pragma Assert (Object.Entry_Names /= null);
-
- Object.Entry_Names (Entry_Index (Pos)) := Val;
- end Set_Entry_Name;
+ Object.Entry_Names := Names;
+ end Set_Entry_Names;
--------------------
-- Unlock_Entries --