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.

Anthony

-- 
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++0x thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net