Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-05-04 06:54:09


> > I think that this is a good plan. BOOST_HAS_THREADS is used in
> > Boost.SmartPtr and Boost.RegEx to indicate "the compiler can create
> > threads, use a mutex." It's used in Boost.Threads to issue an #error.
> > It seems that
> > if we leave BOOST_HAS_THREADS on in multithreaded Windows builds
> > regardless of BOOST_DISABLE_WIN32, nothing (that currently works)
> > will break. John?

OK, lets try it and see, it will stop regex compiling in ansi mode, but
that's about all.

> The following would be even clearer, I think:
>
> Introduce a new #define for cases when we know that there are multiple
> threads but we fail to detect a particular threading library, e.g.
> BOOST_HAS_UNKNOWN_THREADS. Of course, boost/threads would simply fail to
> compile with BOOST_HAS_UNKNOWN_THREADS. Make sure BOOST_HAS_THREADS
remains
> turned on when BOOST_HAS_UNKNOWN_THREADS is turned on.

I think the libraries concerned may to know which threading API will be used
even if they don't call it directly (there may be different struct sizes and
alignments, or code heuristics depending which is in use).

John.


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