diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-01-21 06:44:25 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:10:58 -0400 |
commit | b68c1670b7d40b09be2995e1e730ce4c87eb688c (patch) | |
tree | 3b8fa447ce36bcc0602fff3dfaa145ede658aa87 /gcc/ada/libgnarl/s-taprop__qnx.adb | |
parent | bbe376e136edb8456088d7298d4ba7c93d4e0529 (diff) | |
download | gcc-b68c1670b7d40b09be2995e1e730ce4c87eb688c.zip gcc-b68c1670b7d40b09be2995e1e730ce4c87eb688c.tar.gz gcc-b68c1670b7d40b09be2995e1e730ce4c87eb688c.tar.bz2 |
[Ada] Remove System.Parameters.Single_Lock
2020-06-04 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnarl/a-dynpri.adb, libgnarl/a-taside.adb,
libgnarl/a-taster.adb, libgnarl/s-interr.adb,
libgnarl/s-interr__sigaction.adb, libgnarl/s-taasde.adb,
libgnarl/s-taenca.adb, libgnarl/s-taenca.ads,
libgnarl/s-taprop.ads, libgnarl/s-taprop__hpux-dce.adb,
libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
libgnarl/s-tasque.adb, libgnarl/s-tasque.ads,
libgnarl/s-tasren.adb, libgnarl/s-tasren.ads,
libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb,
libgnarl/s-tasuti.ads, libgnarl/s-tpoben.adb,
libgnarl/s-tpobop.adb, libgnarl/s-tpopmo.adb,
libgnarl/s-tposen.adb, libgnat/s-parame.ads,
libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads,
libgnat/s-parame__vxworks.ads: Remove references to Single_Lock
and Global_Lock.
Diffstat (limited to 'gcc/ada/libgnarl/s-taprop__qnx.adb')
-rw-r--r-- | gcc/ada/libgnarl/s-taprop__qnx.adb | 70 |
1 files changed, 24 insertions, 46 deletions
diff --git a/gcc/ada/libgnarl/s-taprop__qnx.adb b/gcc/ada/libgnarl/s-taprop__qnx.adb index 3479ca5..52d353c 100644 --- a/gcc/ada/libgnarl/s-taprop__qnx.adb +++ b/gcc/ada/libgnarl/s-taprop__qnx.adb @@ -82,7 +82,7 @@ package body System.Task_Primitives.Operations is Single_RTS_Lock : aliased RTS_Lock; -- This is a lock to allow only one thread of control in the RTS at -- a time; it is used to execute in mutual exclusion from all other tasks. - -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List + -- Used to protect All_Tasks_List Environment_Task_Id : Task_Id; -- A variable to hold Task_Id for the environment task @@ -458,25 +458,18 @@ package body System.Task_Primitives.Operations is end if; end Write_Lock; - procedure Write_Lock - (L : not null access RTS_Lock; - Global_Lock : Boolean := False) - is + procedure Write_Lock (L : not null access RTS_Lock) is Result : Interfaces.C.int; begin - if not Single_Lock or else Global_Lock then - Result := pthread_mutex_lock (L); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_lock (L); + pragma Assert (Result = 0); end Write_Lock; procedure Write_Lock (T : Task_Id) is Result : Interfaces.C.int; begin - if not Single_Lock then - Result := pthread_mutex_lock (T.Common.LL.L'Access); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_lock (T.Common.LL.L'Access); + pragma Assert (Result = 0); end Write_Lock; --------------- @@ -500,24 +493,18 @@ package body System.Task_Primitives.Operations is pragma Assert (Result = 0); end Unlock; - procedure Unlock - (L : not null access RTS_Lock; Global_Lock : Boolean := False) - is + procedure Unlock (L : not null access RTS_Lock) is Result : Interfaces.C.int; begin - if not Single_Lock or else Global_Lock then - Result := pthread_mutex_unlock (L); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_unlock (L); + pragma Assert (Result = 0); end Unlock; procedure Unlock (T : Task_Id) is Result : Interfaces.C.int; begin - if not Single_Lock then - Result := pthread_mutex_unlock (T.Common.LL.L'Access); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_unlock (T.Common.LL.L'Access); + pragma Assert (Result = 0); end Unlock; ----------------- @@ -551,9 +538,7 @@ package body System.Task_Primitives.Operations is Result := pthread_cond_wait (cond => Self_ID.Common.LL.CV'Access, - mutex => (if Single_Lock - then Single_RTS_Lock'Access - else Self_ID.Common.LL.L'Access)); + mutex => Self_ID.Common.LL.L'Access); -- EINTR is not considered a failure @@ -713,8 +698,7 @@ package body System.Task_Primitives.Operations is -- Initialize_TCB -- -------------------- - procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) - is + procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is Result : Interfaces.C.int; Cond_Attr : aliased pthread_condattr_t; @@ -725,14 +709,12 @@ package body System.Task_Primitives.Operations is Next_Serial_Number := Next_Serial_Number + 1; pragma Assert (Next_Serial_Number /= 0); - if not Single_Lock then - Result := Init_Mutex (Self_ID.Common.LL.L'Access, Any_Priority'Last); - pragma Assert (Result = 0); + Result := Init_Mutex (Self_ID.Common.LL.L'Access, Any_Priority'Last); + pragma Assert (Result = 0); - if Result /= 0 then - Succeeded := False; - return; - end if; + if Result /= 0 then + Succeeded := False; + return; end if; Result := pthread_condattr_init (Cond_Attr'Access); @@ -751,10 +733,8 @@ package body System.Task_Primitives.Operations is if Result = 0 then Succeeded := True; else - if not Single_Lock then - Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access); + pragma Assert (Result = 0); Succeeded := False; end if; @@ -894,10 +874,8 @@ package body System.Task_Primitives.Operations is Result : Interfaces.C.int; begin - if not Single_Lock then - Result := pthread_mutex_destroy (T.Common.LL.L'Access); - pragma Assert (Result = 0); - end if; + Result := pthread_mutex_destroy (T.Common.LL.L'Access); + pragma Assert (Result = 0); Result := pthread_cond_destroy (T.Common.LL.CV'Access); pragma Assert (Result = 0); @@ -1191,7 +1169,7 @@ package body System.Task_Primitives.Operations is procedure Lock_RTS is begin - Write_Lock (Single_RTS_Lock'Access, Global_Lock => True); + Write_Lock (Single_RTS_Lock'Access); end Lock_RTS; ---------------- @@ -1200,7 +1178,7 @@ package body System.Task_Primitives.Operations is procedure Unlock_RTS is begin - Unlock (Single_RTS_Lock'Access, Global_Lock => True); + Unlock (Single_RTS_Lock'Access); end Unlock_RTS; ------------------ |