title: Boost Asio - How to know when the handler queue is empty?
body: <p>I am currently posting handlers to my io_service and execute them in a thread pool.</p>
  
  <pre><code>io_serv.post( boost::bind(&amp;Class::bar, p1, p2) );
  </code></pre>
  
  <p>My workers run this function:</p>
  
  <pre><code>m_mutex.lock();
  std::cout &lt;&lt; "[" &lt;&lt; boost::this_thread::get_id()
          &lt;&lt; "] Thread Start" &lt;&lt; std::endl;
  m_mutex.unlock();
  
  size_t tasks = m_serv.run();
  
  m_mutex.lock();
  std::cout &lt;&lt; "[" &lt;&lt; boost::this_thread::get_id() &lt;&lt; "] accomplished "
            &lt;&lt; tasks &lt;&lt; " tasks" &lt;&lt; std::endl;
  m_mutex.unlock();
  </code></pre>
  
  <p>So far so good but now <strong>I want to trigger an event when the handler queue is empty without killing my active (but waiting) threads.</strong></p>
  
  <p>Is it possible and how ?</p>