title: ThreadPoolTaskScheduler not work with pool of threads
body: <p>I create </p>
  
  <pre><code>@Bean
  ThreadPoolTaskScheduler taskScheduler(){
      ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
      threadPoolTaskScheduler.setPoolSize(5);
      threadPoolTaskScheduler.setAwaitTerminationSeconds(1);
      threadPoolTaskScheduler.setThreadNamePrefix("Test-");
      threadPoolTaskScheduler.initialize();
      return threadPoolTaskScheduler;
  }
  </code></pre>
  
  <p>And in my component I use it:</p>
  
  <pre><code>@PostConstruct
      public void test() {
          taskScheduler.scheduleWithFixedDelay(() -&gt; {
              try {
                  Thread.sleep(9000L);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
              log.info("test");
          }, 1000L);
      }
  </code></pre>
  
  <p>I wait that each 1 second will start one thread from <code>PoolSize(5)</code>, and after 5 tims pool will full and I will wait first free thread and it thread continue work.</p>
  
  <p>But in real I see next: </p>
  
  <pre><code>2018-09-04 18:06:42.769  INFO 10128 --- [main] c.e.scheduling.SchedulingApplication : Started SchedulingApplication in 1.69 seconds (JVM running for 2.193)
  2018-09-04 18:06:51.385  INFO 10128 --- [Test-1] com.example.scheduling.MyScheduler : test
  2018-09-04 18:07:01.387  INFO 10128 --- [Test-1] com.example.scheduling.MyScheduler : test
  2018-09-04 18:07:11.389  INFO 10128 --- [Test-2] com.example.scheduling.MyScheduler : test
  </code></pre>
  
  <p>One thread print test each 9 seconds</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>I tested</p>
  
  <p><code>scheduleAtFixedRate</code> - the result is the same</p>
  
  <p><strong>EDIT2</strong>:</p>
  
  <pre><code>@PostConstruct
  public void test() {
      taskScheduler.scheduleAtFixedRate(this::test2, 1000L);
  }
  
  @Async
  public void test2() {
      try {
          Thread.sleep(9000L);
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
      log.info("test");
  }
  
  @EnableAsync
  @EnableScheduling
  @Configuration
  public class JavaConfig {
  </code></pre>
  
  <p>Not helped:</p>
  
  <pre><code>2018-09-05 10:31:40.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:31:49.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:31:58.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:07.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:16.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:25.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:34.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:43.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:32:52.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:33:01.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:33:10.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  2018-09-05 10:33:19.160  INFO 13636 --- [         Test-3] com.example.scheduling.MyScheduler       : test
  </code></pre>