Boost logo

Boost :

Subject: Re: [boost] [thread] 1.41.0 regression
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2009-12-16 03:53:19


Anthony Williams wrote:
> That won't make any difference. All the thread structures that are
> defined in header files must have the same layout in the app as in the
> thread library, otherwise you will either get linker errors or (worse)
> runtime errors due to incorrect structure offsets.
>
>
Agree.
> The solution is to use the same compiler flags when you build your
> application as when you build the boost thread library, to ensure that
> the structures have the same layout.
>
>
The same flags, etc are not feasible. Many users have their boost
libraries prebuilt by the distromakers.
When someone distributes a library which uses Boost.Thread the users
have to build it with the same flags the Boost.Thread library was built.
They don't know which flags Boost.Thread was built with.

Having both the thread_data_base constructor and
make_external_thread_data() reside either in a .cpp file or in a header
eliminates the issue.
Are there reasons not to?

BR, Dmitry


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