Boost logo

Boost Users :

Subject: Re: [Boost-users] at_thread_exit() never getting called
From: cowwoc (cowwoc_at_[hidden])
Date: 2009-11-08 13:56:14


Peter Dimov-5 wrote:
>
> atexit handlers (and global/static variable destructors) are invoked by
> the
> thread that calls exit() (or returns from main). at_thread_exit handlers
> (and thread-specific variable destructors) should be invoked by the thread
> that called at_thread_exit, after it exits from its thread function.
>

One of my threads has the following logic:

{
  at_thread_exit(myHook);
  while (!shutdownRequested)
  {
    // do stuff
  }
}

myHook()
{
  shutdownRequested = true;
}

       Following your scenario, doesn't this mean that the shutdown hook
will never get executed? What will happen? Will exit() hang forever? What do
you propose I do instead?

Thanks,
Gili

-- 
View this message in context: http://old.nabble.com/at_thread_exit%28%29-never-getting-called-tp26053513p26256720.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net