summaryrefslogtreecommitdiff
path: root/gcc/ada/s-tpoben.adb
diff options
context:
space:
mode:
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 88527315e42..3249122b386 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 Entry_Index
+ is
+ begin
+ return Entry_Index (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 --