Browse Source

utcfpmonitor: fix compilation on targets where TThreadID is not an ordinal

Jonas Maebe 8 months ago
parent
commit
ccf1bf8add
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/rtl-objpas/tests/utcfpmonitor.pas

+ 2 - 2
packages/rtl-objpas/tests/utcfpmonitor.pas

@@ -137,7 +137,7 @@ begin
 
 
   except
   except
     On E : Exception do
     On E : Exception do
-      Writeln(StdErr,GetTickCount64,': Thread ',GetCurrentThreadID,' exception ',E.ClassName,' during operation ',FOperation,' : ',E.Message);
+      Writeln(StdErr,GetTickCount64,': Thread ',ptruint(GetCurrentThreadID),' exception ',E.ClassName,' during operation ',FOperation,' : ',E.Message);
   end;
   end;
   {$IFDEF DEBUG_MONITOR}Writeln(StdErr,GetTickCount64,': Thread ',GetCurrentThreadID,' End executing operation ',FOperation);{$ENDIF}
   {$IFDEF DEBUG_MONITOR}Writeln(StdErr,GetTickCount64,': Thread ',GetCurrentThreadID,' End executing operation ',FOperation);{$ENDIF}
 end;
 end;
@@ -297,7 +297,7 @@ begin
   DoCreateThread(Obj1,toTryEnter,1,0);
   DoCreateThread(Obj1,toTryEnter,1,0);
   Sleep(WaitPeriod);
   Sleep(WaitPeriod);
   TMonitor.Exit(Obj1);
   TMonitor.Exit(Obj1);
-  Writeln(GetTickCount64,': Thread ',GetCurrentThreadID,' Released lock');
+  Writeln(GetTickCount64,': Thread ',ptruint(GetCurrentThreadID),' Released lock');
   WaitForAllThreads;
   WaitForAllThreads;
   AssertEquals('Thread tried a lock ',toTryEnter,Obj1.Res[1].Op);
   AssertEquals('Thread tried a lock ',toTryEnter,Obj1.Res[1].Op);
   AssertFalse('Thread lock failed ',Obj1.Res[1].Res);
   AssertFalse('Thread lock failed ',Obj1.Res[1].Res);