TJobs Waitfor All

Issue #9 resolved
Peter Gore created an issue

procedure TJobs.WaitForAll(Timeout : Cardinal = 0); var dtStart : TDateTime; begin dtStart := Now; while ((FJobs.Count > 0) or (FJobsInProcess > 0)) and ( (Timeout = 0) or ((Timeout > 0) and (MillisecondsBetween(dtStart,Now) >= Timeout)) ) do sleep(10); end;

Should be procedure TJobs.WaitForAll(Timeout : Cardinal = 0); var dtStart : TDateTime; begin dtStart := Now; while ((FJobs.Count > 0) or (FJobsInProcess > 0)) and ( (Timeout = 0) or ((Timeout > 0) and (MillisecondsBetween(dtStart,Now) <= Timeout)) ) do sleep(10); end;

Comments (3)

  1. Log in to comment