Boost logo

Boost :

From: Sean Huang (huangsean_at_[hidden])
Date: 2005-08-11 14:03:50


> Hi, I'm having an assertion failed when trying to finish my application.
> I use Boost.Thread to create one thread and use serialization and
> spirit that I know use threads either. It wasnt happening when using
> an earlier boost cvs version... And for some reason I'm not being able
> to debug it, when trying to the app finishes when reaching the MSVC.
>
> I'm using MSVC 7.1 and the assertion is:
>
> File: boost-path\libs\thread\build\..\src\tss_hooks.cpp
> Line: 131
>
> Expression: attached_thread_count == 0
>
> This application uses different threads to create and destroy objects
> throughout its lifetime(probably even the static/singleton objects).
>
> It is an COM object and is accessed through "RPC", where the creation
> of the singletons takes place...
>

Felipe,

You will get this assertion whenever you use any Windows services that
maintain a thread pool. COM/RPC is one of the examples. The problem is the
threads from these pools are still around when main returns. I have not
found out a way to control these threads. What I have done is to call
on_thread_exit at the end of all my thread routines. In a way, this has
rendenered automatic thread local storage cleanup on Windows
useless(remember all those heated discussion about static boost::thread
libraries?).

HTH,

Sean


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk