I get an ever increasing(like 1,2,3,4,5,6,7...) task count when I print s.getTaskCount(). I don't understand why.
public class MyTask implements Runnable
{
public void run()
{
System.out.println("whatever....");
}
}
ScheduledThreadPoolExecutor s = new ScheduledThreadPoolExecutor(3);
s.scheduleAtFixedRate(new MyTask(), 0, 10, TimeUnit.SECONDS);
while(1>0)
{
try
{
System.out.println("TASK COUNT: "+s.getTaskCount());
Thread.sleep(60000);
}
catch(InterruptedException e)
{
System.out.println(e);
}
}