Ver Fonte

* reduced waiting steps in emulated "timed wait" in basiceventwaitfor
further from 50ms to 20ms (mantis #9895)

git-svn-id: trunk@12813 -

Jonas Maebe há 16 anos atrás
pai
commit
9e7efd7321
1 ficheiros alterados com 7 adições e 7 exclusões
  1. 7 7
      rtl/unix/cthreads.pp

+ 7 - 7
rtl/unix/cthreads.pp

@@ -829,16 +829,16 @@ begin
         result := wrError;
 {$else}
       timespec.tv_sec:=0;
-      { 50 miliseconds or less -> wait once for this duration }
-      if (timeout <= 50) then
+      { 20 miliseconds or less -> wait once for this duration }
+      if (timeout <= 20) then
         loopcnt:=1
-      { otherwise wake up every 50 msecs to check    }
+      { otherwise wake up every 20 msecs to check    }
       { (we'll wait a little longer in total because }
       {  we don't take into account the overhead)    }
       else
         begin
-          loopcnt := timeout div 50;
-          timespec.tv_nsec:=50*1000000;
+          loopcnt := timeout div 20;
+          timespec.tv_nsec:=20*1000000;
         end;
       result := wrTimeOut;
       nanores := 0;
@@ -847,7 +847,7 @@ begin
         begin
           { in the last iteration, wait for the amount of time left }
           if (i = loopcnt) then
-            timespec.tv_nsec:=(timeout mod 50) * 1000000;
+            timespec.tv_nsec:=(timeout mod 20) * 1000000;
           timetemp:=timespec;
           lastloop:=false;
           { every time our sleep is interrupted for whatever reason, }
@@ -1096,4 +1096,4 @@ initialization
     end;
   SetCThreadManager;
 finalization
-end.
+end.