Ver Fonte

* Fix some debug output

Michaël Van Canneyt há 4 anos atrás
pai
commit
5a6bea6180
1 ficheiros alterados com 6 adições e 8 exclusões
  1. 6 8
      packages/fcl-base/src/fpthreadpool.pp

+ 6 - 8
packages/fcl-base/src/fpthreadpool.pp

@@ -1,7 +1,7 @@
-unit fpthreadpool;
+ unit fpthreadpool;
 
 {$mode ObjFPC}{$H+}
-{ $DEFINE DEBUGTHREADPOOL}
+{$DEFINE DEBUGTHREADPOOL}
 
 interface
 
@@ -780,17 +780,15 @@ begin
       T.Task:=aTask
     else
       begin
-      {$IFDEF DEBUGTHREADPOOL}DoLog('No available thread for task %s waiting %d to %d',[aTask.ToString,FAddWaitIntervalFAddTimeOut]);{$ENDIF}
-      Flush(output);
+      {$IFDEF DEBUGTHREADPOOL}DoLog('No available thread for task %s waiting %d to %d',[aTask.ToString,FAddWaitInterval,FAddTimeOut]);{$ENDIF}
       if WaitStart=0 then
         WaitStart:=Now;
       Sleep(FAddWaitInterval);
       TimeOut:=(FAddTimeOut>0) and (MillisecondsBetween(Now,WaitStart)>FAddTimeout);
+      {$IFDEF DEBUGTHREADPOOL}
       If TimeOut then
-        begin
-        {$IFDEF DEBUGTHREADPOOL}DoLog('TimeOut reached: ',TimeOut);{$ENDIF}
-        Flush(output);
-        end;
+        DoLog('TimeOut reached: ',TimeOut);
+      {$ENDIF}
       end;
   Until Result or TimeOut;
 end;