title: breaking out from socket select
body: <p>I have a loop which basically calls this every few seconds (after the timeout):</p>
  
  <pre><code> while(true){
  
      if(finished)
         return;
  
      switch(select(FD_SETSIZE, &amp;readfds, 0, 0, &amp;tv)){
          case SOCKET_ERROR : report bad stuff etc; return;
          default : break;
      }
  
      // do stuff with the incoming connection
   }
  </code></pre>
  
  <p>So basically for every few seconds (which is specified by tv), it reactivates the listening. </p>
  
  <p>This is run on thread B (not a main thread). There are times when I want to end this acceptor loop immediately from thread A (main thread), but seems like I have to wait until the time interval finishes..</p>
  
  <p>Is there a way to disrupt the select function from another thread so thread B can quit instantly?</p>