Boost logo

Boost :

From: David Deakins (ddeakins_at_[hidden])
Date: 2007-11-14 16:37:13


In the most recent thread library changes from a day or so ago, the
set_tss_data function was added to win32/thread.cpp. This function
calls tss_cleanup_implemented to force some support for TSS cleanup to
be present. Unfortunately, since set_tss_data is in the .cpp file
(rather than being an inline function in a .hpp file) this requires
tss_cleanup_implemented to always be present for WinThread versions of
the static library, regardless of whether or not TSS is actually used.
Since WinCE does not currently have a nifty automated way to clean up
TSS in static builds, this means that there is always a link error when
the static library is used (even when no TSS data is allocated). As an
alternative, could the call to tss_cleanup_implemented() be moved to the
thread_specific_ptr::reset() and thread_specific_ptr::release()
functions in win32/tss.hpp, so that the link error only shows up if some
TSS data is created?

Incidentally, while looking through this, I had a question about
src/tss_null.cpp. Does this file actually accomplish anything at the
moment? It appears that it is intended to patch in an empty version of
tss_cleanup_implemented() for WinThread builds when _MSC_VER is not
defined. However, the #if block around the function definition includes
the clause (defined(BOOST_THREAD_BUILD_LIB) ||
defined(BOOST_THREAD_TEST)). As far as I can tell, this file is not
included in any static library build by thread/build/Jamfile.v2 and none
of the test files declare BOOST_THREAD_TEST. So I'm not sure when this
function definition would actually come into play. Just curious.

Thanks,
-Dave


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