Boost logo

Boost :

From: Joe Gottman (jgottman_at_[hidden])
Date: 2008-04-03 19:35:32


Peter Dimov wrote:
> Joe Gottman quite correctly points out in
>
> http://svn.boost.org/trac/boost/ticket/1762
>
> that shared_ptr should honor user definitions of BOOST_DISABLE_THREADS and
> disable MT support.
>
> Unfortunately, despite documenting quite clearly that BOOST_DISABLE_THREADS
> is a user macro, Boost.Config defines it in some situations. This means that
> I can't rely on this macro to reflect the user's intent, as I don't know
> whether it's been set explicitly by the user, or implicitly (and incorrectly
> IMO) by Boost.Config.
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

    The code in suffix.hpp looks like

#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
    && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
# define BOOST_DISABLE_THREADS
#endif

As far as I can tell, the purpose of this is to disable threading if
Windows is disabled and there is no other threading system available. I
think we can get the same result in a much clearer fashion without
touching BOOST_DISABLE_THREADS by the following:

#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32)
# undef BOOST_HAS_WINTHREADS
#endif

Joe Gottman


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