Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] Solution to conflict with MFC?
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2011-04-27 12:24:32

Daniel Bradburn <moagstar_at_[hidden]> writes:

> I'm not sure how restrictive this would be for you but perhaps you could try
> statically linking the runtime and mfc libraries rather than dynamically
> linking them?

I would suggest that the reverse is preferable: dynamically link the
boost.thread library.

If you must statically link boost.thread, it might be worth trying putting

namespace boost
        void tss_cleanup_implemented()

in your DLL's code. This should avoid linking in the problematic part of
the boost library (though I haven't tried it). You will then need to
ensure that every thread that uses boost.thread facilities (especially
boost::thread_specific_ptr) and is not started with boost::thread calls
boost::on_thread_exit() when it exits.


Author of C++ Concurrency in Action
just::thread C++0x thread library   
Just Software Solutions Ltd
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at