title: C++ Singleton Threading problem
body: <p>I have a C++ singleton that runs as a separate thread.  This singleton is derived from a base class provided by a library and it overrides the method onLogon(...).  The onLogon method is synchronous, it wants to know right away if we accept the logon attempt.</p>
  
  <p>Problem is we need to pass the logon information via message to a security server.  We can register a callback with the security server listener (a separate thread) to get the results of the logon authentication message we sent.  My question is how do I block in the onLogon method such that I can have the thread woken up by the callback I've registered with the security server listener thread, and how can I then access the response returned from the security server in a thread-safe way (ie, I need to be able to handle multiple concurrent logon requests).</p>
  
  <p>I'm totally stumped.</p>