From 42b7249641797d313102baee0d497a92e393a275 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Fri, 20 Jul 2007 18:07:04 +0000 Subject: Reduce waiting time for threads --- src/net/sf/antcontrib/cpptasks/CCTask.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java index 5116ee7..bd31ccc 100644 --- a/src/net/sf/antcontrib/cpptasks/CCTask.java +++ b/src/net/sf/antcontrib/cpptasks/CCTask.java @@ -806,7 +806,8 @@ public class CCTask extends Task { } } if (alive) { - Thread.sleep(5000); + // wait for a maximum of 5 seconds or #files*2 seconds. + Thread.sleep(Math.min(5000, sourceFiles[0].size()*2000)); } } while (alive); } catch (InterruptedException e) { @@ -997,7 +998,9 @@ public class CCTask extends Task { + rebuildCount + " files compiled..."); System.err.print("\r"); System.err.flush(); - Thread.sleep(5000); + if (!stop) { + Thread.sleep(5000); + } } } catch (InterruptedException e) { } -- cgit v1.2.3