Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-07-19 09:35:49

Peter Dimov wrote:
> Michael Glassford wrote:
>>Replying to myself: I forgot to mention: it's easy enough to make
>>threads created by Boost.Threads call on_thread_exit() after the
>>thread function exits. Does anyone see any drawbacks to doing this?
> No, as long as it is safe to call the on_thread_exit callback twice.

It can, and I've checked in the change.

> However did you consider the alternative design of
> void at_thread_exit( void (*pf)() );
> (along the lines of atexit).

There was already an add_thread_exit() that did this; at_thread_exit is
a better name, so I've just checked in the changes to use it. Functions
passed to at_thread_exit() are what get called by on_thread_exit(). The
dll version of Boost.Threads on Win32 calls on_thread_exit()
automatically when a thread exits; in static builds of Boost.Threads,
the user is responsible for calling on_thread_exit(), though hopefully
this will change in a future Boost.Threads release.

Were you suggesting that at_thread_exit be publically exposed as a
feature of Boost.Threads on all platforms?


Boost list run by bdawes at, gregod at, cpdaniel at, john at