"Peter Dimov" <pdimov@mmltd.net> skrev i meddelandet news:00e301c77b79$c29f7d80$6b01a8c0@pdimov...
Johan Nilsson wrote:
Context::MapPtrT Context::g_pCtxMap(&Context::Cleanup);
What is MapPtrT?
Sorry, should have spelled out the declaration: boost::thread_specific_ptr< std::map< "typeid wrapper", std::stack< boost::any > >
(modulo typos)
C++ oasistest.exe!boost::detail::tss::cleanup() + 0x78 bytes C++ oasistest.exe!boost::thread_specific_ptr<boost::shared_ptr<RCF::Session>
:~thread_specific_ptr<boost::shared_ptr<RCF::Session> >() Line 90 + 0x5e bytes C++ oasistest.exe!`dynamic atexit destructor for 'oasis::utility::Context::g_pCtxMap''() + 0xe bytes C++ msvcr80.dll!doexit(int code=0, int quick=0, int retcaller=0) Line 553 C msvcr80.dll!exit(int code=0) Line 398 + 0xd bytes C oasistest.exe!__tmainCRTStartup() Line 603 C kernel32.dll!7c816fd7()
It seems that the static destructors are being run after on_thread_exit for the main thread; that's pretty odd. I see some logic in tss.cpp that looks
like it should handle the case of ordering/race issues between ~thread_specific_ptr and the thread exit cleanup, but the code is too complicated to tell. Maybe you need to instrument tss.cpp and tss_hooks.cpp to see what is being called and when.
I'm trying to avoid that. Will wait a bit more and cross my fingers for someone to see any "obvious" errors. / Johan