title: c++ boost::thread execute code on main thread?
body: <p>Is it possible, after calling a boost::thread running some instructions, to come back to main thread ?</p>
  
  <p>My code is based around proactor pattern, however a certain function may take some time, so in order not to block the whole program, I'm creating a thread running this function.
  When this function is over, I need to call another function, but it has to be run on main thread.
  I have a connection pool, that is not thread safe, and I really would like to avoid mutex.</p>
  
  <p>Is there a stable way to run a function on the main thread (call on another thread) ?</p>
  
  <p>Just like in ObjectiveC <strong>performSelectorOnMaintThread</strong></p>