Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#4071 closed Patches (fixed)

unique_lock fails with recent Sun Studio compilers

Reported by: stephen.clamage@… Owned by: Anthony Williams
Milestone: Boost 1.43.0 Component: thread
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

boost/thread/locks.hpp has conditional code applied to all Sun Studio compilers, but recent compilers don't produce the right result with the workarounds. The workarounds should be restricted to older compilers (a one-line change in two places). Here are the diffs:

--- boost/thread/locks.hpp (revision 61052) +++ boost/thread/locks.hpp (working copy) @@ -214,7 +214,7 @@

unique_lock& operator=(unique_lock&); unique_lock& operator=(upgrade_lock<Mutex>& other);

public:

-#ifdef SUNPRO_CC +#if BOOST_WORKAROUND(SUNPRO_CC, < 0x5100)

unique_lock(const volatile unique_lock&);

#endif

unique_lock():

@@ -300,7 +300,7 @@

return detail::thread_move_t<unique_lock<Mutex> >(*this);

}

-#ifdef SUNPRO_CC +#if BOOST_WORKAROUND(SUNPRO_CC, < 0x5100)

unique_lock& operator=(unique_lock<Mutex> other) {

swap(other);

Change History (6)

comment:1 by chris_kohlhoff, 13 years ago

Component: Nonethread
Owner: set to Anthony Williams
Summary: ASIO library fails with recent Sun Studio compilersunique_lock fails with recent Sun Studio compilers

comment:2 by viboes, 12 years ago

Type: BugsPatches

comment:3 by Anthony Williams, 12 years ago

Resolution: fixed
Status: newclosed

Fixed on trunk.

comment:4 by anonymous, 12 years ago

I think the patch got messed up because of wiki formatting, and that should be:

#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)

This is causing a warning, in #4363.

comment:5 by stephen.clamage@…, 12 years ago

Yes, in the wiki view, two lines are merged into one in two places.

comment:6 by anonymous, 12 years ago

I was referring to the __ in __SUNPRO_CC which was interpreted as underline markup and was stripped out, which is why the commit used SUNPROC_CC which causes the warning.

Note: See TracTickets for help on using tickets.