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.
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
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;
function SetThreadAffinityMask
(hThread : HANDLE;
- dwThreadAffinityMask : DWORD) return DWORD;
+ dwThreadAffinityMask : DWORD) return DWORD_PTR;
pragma Import (Stdcall, SetThreadAffinityMask, "SetThreadAffinityMask");
--------------