Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-07-17 18:06:20

Aaron W. LaFramboise 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?
> Would this mechanism be able to deal extraneous on_thread_exit calls due
> to the user-provided handler calling on_thread_exit (since an
> implementation I have in mind would have no idea if a thread was Boost
> thread or not)?

It should be OK for on_thread_exit to be called multiple times on a
thread, and for on_process_exit to be called multiple times as well. The
only problem is if one of the calls happens too early (e.g. calling
on_thread_exit before the thread is done using tss, or calling
on_process_exit before on_thread_exit has been called for all threads).

Even if one of the functions gets called too soon the worst thing that
should happen is that expected data won't be there or (if
on_process_exit gets called before on_thread_exit), leaks.

> Now that you've formed this interface, I plan on submitting an
> implementation for this function (that I mentioned previously) that I'd
> expect to work on at least MSVC and future versions of Windows GCC, by
> the end of the July.

Thanks! I was going to ask about it, and look forward to seeing it.


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