diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2024-04-15 14:17:13 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-06-10 11:03:59 +0200 |
commit | c5aa1535e1328af279b8145fef1ae6fdc91b75fa (patch) | |
tree | 38292c938be7265a85271b24457d070b61ac2075 /gcc/ada/libgnarl | |
parent | aec9d8c9f5d673ff745f7b0560966e98b1404a53 (diff) | |
download | gcc-c5aa1535e1328af279b8145fef1ae6fdc91b75fa.zip gcc-c5aa1535e1328af279b8145fef1ae6fdc91b75fa.tar.gz gcc-c5aa1535e1328af279b8145fef1ae6fdc91b75fa.tar.bz2 |
ada: Fix usage of SetThreadAffinityMask
This patches fixes the signature of the binding to SetThreadAffinityMask
in the run-time library. It also fixes the error checking after calls
to SetThreadAffinityMask. The previous code behaved as if
SetThreadAffinityMask returned 1 on success, but it in fact returns a
pointer value on success and 0 on failure.
gcc/ada/
* libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of
SetThreadAffinityMask.
* libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding
signature.
Diffstat (limited to 'gcc/ada/libgnarl')
-rw-r--r-- | gcc/ada/libgnarl/s-taprop__mingw.adb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/libgnarl/s-taprop__mingw.adb b/gcc/ada/libgnarl/s-taprop__mingw.adb index 38e281c..f77d719 100644 --- a/gcc/ada/libgnarl/s-taprop__mingw.adb +++ b/gcc/ada/libgnarl/s-taprop__mingw.adb @@ -1340,7 +1340,7 @@ package body System.Task_Primitives.Operations is then declare CPU_Set : DWORD := 0; - + Mask_Result : DWORD_PTR; begin for Proc in T.Common.Domain'Range loop if T.Common.Domain (Proc) then @@ -1352,8 +1352,8 @@ package body System.Task_Primitives.Operations is end if; end loop; - Result := SetThreadAffinityMask (T.Common.LL.Thread, CPU_Set); - pragma Assert (Result = 1); + Mask_Result := SetThreadAffinityMask (T.Common.LL.Thread, CPU_Set); + pragma Assert (Mask_Result /= 0); end; end if; end Set_Task_Affinity; |