Opened 15 years ago

Closed 15 years ago

#1243 closed Bugs (fixed)

ODR violation by boost::detail::lightweight_mutex

Reported by: Joaquín M López Muñoz Owned by: Peter Dimov
Milestone: Boost 1.35.0 Component: None
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

boost/detail/flyweight_mutex.hpp implements a mutex class based on a Win32 CRITICAL_SECTION or using Pthreads according to the following pp logic:

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  // based on CRITICAL_SECTION
#elif defined(BOOST_HAS_PTHREADS)
  // based on Pthreads

which violates ODR on those environments, such as Cygwin, where WIN32 or similar is not a predefined macro but depends on the inclusion of <windows.h>.

A more detailed discussion of the issue at:

http://lists.boost.org/Archives/boost/2007/09/127115.php

Change History (2)

comment:1 by Peter Dimov, 15 years ago

Milestone: To Be DeterminedBoost 1.35.0
Status: newassigned

comment:2 by Peter Dimov, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [39199]) Fixes #1243

Note: See TracTickets for help on using tickets.