Boost.Thread tss_cleanup_implemented question
I'm having some difficulty understanding what I need to implement in tss_cleanup_implemented when using boost.thread I'm using Windows Borland C++ Builder 6 (bcc32 v5.6.4) Roguewave stl Static (.lib) build of boost.thread In my project I #define BOOST_THREAD_USE_LIB My first problem was a pair of unresolved externals - this seems to happen occasionally with boost, bcb6 & roguewave. The missing definitions were boost::thread::thread(boost::function0<void>&) and boost::detail::tss::init(boost::function1<void, void *, std::allocator<boost::function_base> > *) I resolved these by forcing the compiler to generate the relevant code by #including the implementation definitions and creating a function which is never called so: #if (__BORLANDC__ >= 0x560) && defined(_USE_OLD_RW_STL) #include <boost/thread.hpp> #include <boost/thread/tss.hpp> #include <libs/thread/src/thread.cpp> #include <libs/thread/src/tss.cpp> void DummyFuncToGenerateTemplateSpecializations(void) { // This forces generation of // boost::thread::thread(boost::function0<void>&) boost::function0<void> A = NULL; boost::thread B(A); // This forces generation of // boost::detail::tss::init(boost::function1<void, void *, // std::allocator<boost::function_base> > *) // but has the consequence of requiring the deliberately undefined function // tss_cleanup_implemented boost::function1<void, void*>* C = NULL; boost::detail::tss D(C); } But this then causes a call to the deliberately undefined tss_cleanup_implemented so I get another unresolved external. I can't find any info on the sort of thing I need to implement in tss_cleanup_implemented. What should I be doing? Or I have gone wrong somewhere else? Thanks in anticipation Simon
participants (1)
-
Simon Carter