Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-05-12 05:56:49


John Maddock wrote:
> It looks as though _GLIBCXX_HAVE_GTHR_DEFAULT is defined by the std lib
> when it's in thread safe mode, so I'm leaning towards adding:
>
> #ifdef __GLIBCXX__ // gcc 3.4 and greater:
> #ifdef _GLIBCXX_HAVE_GTHR_DEFAULT
> #define BOOST_HAS_THREADS
> #else
> #define BOOST_DISABLE_THREADS
> #endif
> #endif
>
> To our libstdcpp3.hpp config file, which I think will take care of it,
> albeit not in a way that everyone will appreciate (it will force threading
> on whenever the std lib is also thread safe).

Ehm... I don't think Linux has single-threaded and multi-threaded versions of
libstdc++ -- there's only one library installed and it's sure will be
multi-threaded.

So, for single threaded builds
1. Boost will think it's MT build and call pthread_* functions.
2. Toolset won't add '-pthread' to linker command line

Bottom like: you'll get link failures for single-thread builds.

- Volodya


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