|
Boost : |
From: Julien Delacroix (jdelacroix_at_[hidden])
Date: 2006-07-27 05:17:23
Here is the code that handle thread support in
boost/config/platform/hpux.hpp :
#if defined(__GNUC__)
# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3))
// GNU C on HP-UX does not support threads (checked up to gcc 3.3)
# define BOOST_DISABLE_THREADS
# elif !defined(BOOST_DISABLE_THREADS)
// threads supported from gcc-3.3 onwards:
# define BOOST_HAS_THREADS
# define BOOST_HAS_PTHREADS
# endif
#endif
This code does not set BOOST_HAS_THREADS and BOOST_HAS_PTHREADS when
compiling with aCC on HP-UX.
This cause the boost::shared_ptr to be unsafe in a multithreaded
environment .
We fixed this problem by adding the following lines in user.hpp :
// Enable threading support with aCC !!
#ifdef _AMD_THREADS_
# ifdef _AMD_UNIX_HPUX_
# define BOOST_HAS_THREADS
# define BOOST_HAS_PTHREADS
# endif
#endif
But I suggest that in future release you use the following code in
boost/config/platform/hpux.hpp
#if defined(__GNUC__)
# if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3))
// GNU C on HP-UX does not support threads (checked up to gcc 3.3)
# define BOOST_DISABLE_THREADS
# endif
#endif
#if !defined(BOOST_DISABLE_THREADS)
// threads supported
# define BOOST_HAS_THREADS
# define BOOST_HAS_PTHREADS
# endif
Maybe it will be necessary to check aCC version and set
BOOST_DISABLE_THREADS for old aCC version that do not have thread
suport...
Regards
Julien
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk