summaryrefslogtreecommitdiff
path: root/gcc/ada/s-tpoben.adb
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2011-09-27 09:45:00 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-27 11:45:00 +0200
commit64a63cd58bbe195dfa0041d84efbb7062d649b35 (patch)
treee2a86a2cd807af9805a9f75b43e6ab06bf02771c /gcc/ada/s-tpoben.adb
parentf672a756b3c82462fd4b26860a4f916218da64b9 (diff)
downloadgcc-64a63cd58bbe195dfa0041d84efbb7062d649b35.tar.gz
s-osinte-hpux.ads, [...]: Revert previous changes.
2011-09-27 Pascal Obry <obry@adacore.com> * s-osinte-hpux.ads, s-taprop-vxworks.adb, s-taspri-vxworks.ads, s-taprop-tru64.adb, s-osinte-aix.ads, s-taspri-posix-noaltstack.ads, s-taspri-mingw.ads, s-taprop-vms.adb, s-tpoben.adb, s-tpoben.ads, s-taprop-mingw.adb, s-taprob.adb, s-taprob.ads, s-osinte-solaris-posix.ads, s-taprop-solaris.adb, s-taspri-solaris.ads, s-osinte-irix.ads, s-taprop-irix.adb, s-osinte-darwin.ads, s-taspri-dummy.ads, s-taspri-posix.ads, s-taprop.ads, s-taspri-vms.ads, s-osinte-freebsd.ads, s-taprop-hpux-dce.adb, s-taspri-hpux-dce.ads, s-taspri-tru64.ads, s-taprop-dummy.adb, s-taprop-posix.adb: Revert previous changes. (Lock): Now a record containing the two possible lock (mutex and read/write) defined in OS_Interface. * s-taprop-linux.adb (Finalize_Protection): Use r/w lock for 'R' locking policy. (Initialize_Protection): Likewise. (Lock): Likewise. (Lock_Read_Only): Likewise. (Unlock): Likewise. From-SVN: r179253
Diffstat (limited to 'gcc/ada/s-tpoben.adb')
-rw-r--r--gcc/ada/s-tpoben.adb49
1 files changed, 9 insertions, 40 deletions
diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb
index 5c1ebe72581..88527315e42 100644
--- a/gcc/ada/s-tpoben.adb
+++ b/gcc/ada/s-tpoben.adb
@@ -88,11 +88,7 @@ package body System.Tasking.Protected_Objects.Entries is
return;
end if;
- if Locking_Policy = 'R' then
- STPO.Write_Lock (Object.RWL'Unrestricted_Access, Ceiling_Violation);
- else
- STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
- end if;
+ STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
if Single_Lock then
Lock_RTS;
@@ -113,12 +109,7 @@ package body System.Tasking.Protected_Objects.Entries is
Unlock_RTS;
end if;
- if Locking_Policy = 'R' then
- STPO.Write_Lock
- (Object.RWL'Unrestricted_Access, Ceiling_Violation);
- else
- STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
- end if;
+ STPO.Write_Lock (Object.L'Unrestricted_Access, Ceiling_Violation);
if Ceiling_Violation then
raise Program_Error with "Ceiling Violation";
@@ -158,13 +149,9 @@ package body System.Tasking.Protected_Objects.Entries is
Unlock_RTS;
end if;
- if Locking_Policy = 'R' then
- STPO.Unlock (Object.RWL'Unrestricted_Access);
- STPO.Finalize_Lock (Object.RWL'Unrestricted_Access);
- else
- STPO.Unlock (Object.L'Unrestricted_Access);
- STPO.Finalize_Lock (Object.L'Unrestricted_Access);
- end if;
+ STPO.Unlock (Object.L'Unrestricted_Access);
+
+ STPO.Finalize_Lock (Object.L'Unrestricted_Access);
end Finalize;
----------------------
@@ -247,13 +234,7 @@ package body System.Tasking.Protected_Objects.Entries is
-- pragma Assert (Self_Id.Deferral_Level = 0);
Initialization.Defer_Abort_Nestable (Self_ID);
-
- if Locking_Policy = 'R' then
- Initialize_Lock (Init_Priority, Object.RWL'Access);
- else
- Initialize_Lock (Init_Priority, Object.L'Access);
- end if;
-
+ Initialize_Lock (Init_Priority, Object.L'Access);
Initialization.Undefer_Abort_Nestable (Self_ID);
Object.Ceiling := System.Any_Priority (Init_Priority);
@@ -329,11 +310,7 @@ package body System.Tasking.Protected_Objects.Entries is
(STPO.Self.Deferral_Level > 0
or else not Restrictions.Abort_Allowed);
- if Locking_Policy = 'R' then
- Write_Lock (Object.RWL'Access, Ceiling_Violation);
- else
- Write_Lock (Object.L'Access, Ceiling_Violation);
- end if;
+ Write_Lock (Object.L'Access, Ceiling_Violation);
-- We are entering in a protected action, so that we increase the
-- protected object nesting level (if pragma Detect_Blocking is
@@ -387,11 +364,7 @@ package body System.Tasking.Protected_Objects.Entries is
raise Program_Error;
end if;
- if Locking_Policy = 'R' then
- Read_Lock (Object.RWL'Access, Ceiling_Violation);
- else
- Write_Lock (Object.L'Access, Ceiling_Violation);
- end if;
+ Read_Lock (Object.L'Access, Ceiling_Violation);
if Ceiling_Violation then
raise Program_Error with "Ceiling Violation";
@@ -487,11 +460,7 @@ package body System.Tasking.Protected_Objects.Entries is
Object.Ceiling := Object.New_Ceiling;
end if;
- if Locking_Policy = 'R' then
- Unlock (Object.RWL'Access);
- else
- Unlock (Object.L'Access);
- end if;
+ Unlock (Object.L'Access);
end Unlock_Entries;
end System.Tasking.Protected_Objects.Entries;