title: ThreadPoolExecutor and Socket. Thread isn't started
body: <p>I have a class class with main thread  </p>
  
  <pre><code>public class MainThread extends Thread
  {
     private final Socket s;
  
     public MainThread(final Socket s)
     {
        this.s = s;
     }
  
  public void start()  
  { // some logic 
  }  
  }  
  </code></pre>
  
  <p>and class with pool of threads  </p>
  
  <pre><code>public final class MainListener extends Thread
  {
  
     private Socket ss;
  
     public MainListener(final int socket)
     {
        this.socket = socket;
        this.pool = new ThreadPoolExecutor(
           2,
           4,
           1000L,
           TimeUnit.MILLISECONDS,
           new LinkedBlockingQueue&lt;Runnable&gt;());
     }  
  
  public void start()
     {  
  final ServerSocket ss = new ServerSocket(socket);
  while(true)
  {  
      final Socket s = ss.accept();
      pool.execute(new MainThread(s));
  }
  }  
  </code></pre>
  
  <p>MainThread is created but not started. It is 'waiting'.<br>
  What is the problem? How start this thread after creation?<br>
  if I make constructor of MainThread like   </p>
  
  <pre><code>public MainThread(final Socket s)
     {
        this.s = s;
        start();
     }
  </code></pre>
  
  <p>then all works normally. But it's wrong</p>