Subject: [Boost-bugs] [Boost C++ Libraries] #2675: Win32 threading selection in boost/detail/lightweight_mutex.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-01-23 18:25:00
#2675: Win32 threading selection in boost/detail/lightweight_mutex.hpp
--------------------------+-------------------------------------------------
Reporter: joaquin | Owner: pdimov
Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: smart_ptr
Version: Boost 1.37.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
(See discussion at
http://lists.boost.org/Archives/boost/2008/12/146172.php)
Lines 31-40 of boost/detail/lightweight_mutex.hpp read like this:
{{{
#if !defined(BOOST_HAS_THREADS)
# include <boost/detail/lwm_nop.hpp>
#elif defined(BOOST_HAS_PTHREADS)
# include <boost/detail/lwm_pthreads.hpp>
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# include <boost/detail/lwm_win32_cs.hpp>
#else
// Use #define BOOST_DISABLE_THREADS to avoid the error
# error Unrecognized threading platform
#endif
}}}
The conditions for selecting boost/detail/lwm_win32_cs.hpp are
suboptimal because they're ruling out the case where the user's
disabled Pthreads in cygwin/mingw by explicitly defining
BOOST_HAS_WINTHREADS,a case covered by
boost/config/platform/cygwin.hpp: in such a situation, Win32
threading is available but none of WIN32 and similar are defined
by default (unless <windows.h> has been previously included,
which makes boost/detail/lightweight_mutex.hpp context
dependent).
As per the discussion carried out in the list, I think the
best resolution is to have the Win32 selection pp code
changed to
{{{
#elif defined(BOOST_HAS_WINTHREADS) ||\
defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# include <boost/detail/lwm_win32_cs.hpp>
#else
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2675> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC