Ticket #9037: boost-1.54.0-thread-cond_variable_shadow.patch

File boost-1.54.0-thread-cond_variable_shadow.patch, 4.4 KB (added by Petr Machata <pmachata@…>, 9 years ago)

A fix.

  • ./boost/thread/pthread/condition_variable.hpp

    diff -up ./boost/thread/pthread/condition_variable.hpp~ ./boost/thread/pthread/condition_variable.hpp
    old new namespace boost  
    200200
    201201#if defined BOOST_THREAD_USES_DATETIME
    202202        template<typename lock_type>
    203         bool timed_wait(lock_type& m,boost::system_time const& wait_until)
     203        bool timed_wait(lock_type& m,boost::system_time const& a_wait_until)
    204204        {
    205             struct timespec const timeout=detail::to_timespec(wait_until);
     205            struct timespec const timeout=detail::to_timespec(a_wait_until);
    206206            return do_wait_until(m, timeout);
    207207        }
    208208        template<typename lock_type>
    209         bool timed_wait(lock_type& m,xtime const& wait_until)
     209        bool timed_wait(lock_type& m,xtime const& a_wait_until)
    210210        {
    211             return timed_wait(m,system_time(wait_until));
     211            return timed_wait(m,system_time(a_wait_until));
    212212        }
    213213
    214214        template<typename lock_type,typename duration_type>
    namespace boost  
    218218        }
    219219
    220220        template<typename lock_type,typename predicate_type>
    221         bool timed_wait(lock_type& m,boost::system_time const& wait_until,predicate_type pred)
     221        bool timed_wait(lock_type& m,boost::system_time const& a_wait_until,predicate_type pred)
    222222        {
    223223            while (!pred())
    224224            {
    225                 if(!timed_wait(m, wait_until))
     225                if(!timed_wait(m, a_wait_until))
    226226                    return pred();
    227227            }
    228228            return true;
    229229        }
    230230
    231231        template<typename lock_type,typename predicate_type>
    232         bool timed_wait(lock_type& m,xtime const& wait_until,predicate_type pred)
     232        bool timed_wait(lock_type& m,xtime const& a_wait_until,predicate_type pred)
    233233        {
    234             return timed_wait(m,system_time(wait_until),pred);
     234            return timed_wait(m,system_time(a_wait_until),pred);
    235235        }
    236236
    237237        template<typename lock_type,typename duration_type,typename predicate_type>
  • ./boost/thread/pthread/condition_variable_fwd.hpp

    diff -up ./boost/thread/pthread/condition_variable_fwd.hpp~ ./boost/thread/pthread/condition_variable_fwd.hpp
    old new namespace boost  
    9898#if defined BOOST_THREAD_USES_DATETIME
    9999        inline bool timed_wait(
    100100            unique_lock<mutex>& m,
    101             boost::system_time const& wait_until)
     101            boost::system_time const& a_wait_until)
    102102        {
    103103#if defined BOOST_THREAD_WAIT_BUG
    104             struct timespec const timeout=detail::to_timespec(wait_until + BOOST_THREAD_WAIT_BUG);
     104            struct timespec const timeout=detail::to_timespec(a_wait_until + BOOST_THREAD_WAIT_BUG);
    105105            return do_wait_until(m, timeout);
    106106#else
    107             struct timespec const timeout=detail::to_timespec(wait_until);
     107            struct timespec const timeout=detail::to_timespec(a_wait_until);
    108108            return do_wait_until(m, timeout);
    109109#endif
    110110        }
    111111        bool timed_wait(
    112112            unique_lock<mutex>& m,
    113             xtime const& wait_until)
     113            xtime const& a_wait_until)
    114114        {
    115             return timed_wait(m,system_time(wait_until));
     115            return timed_wait(m,system_time(a_wait_until));
    116116        }
    117117
    118118        template<typename duration_type>
    namespace boost  
    126126        template<typename predicate_type>
    127127        bool timed_wait(
    128128            unique_lock<mutex>& m,
    129             boost::system_time const& wait_until,predicate_type pred)
     129            boost::system_time const& a_wait_until,predicate_type pred)
    130130        {
    131131            while (!pred())
    132132            {
    133                 if(!timed_wait(m, wait_until))
     133                if(!timed_wait(m, a_wait_until))
    134134                    return pred();
    135135            }
    136136            return true;
    namespace boost  
    139139        template<typename predicate_type>
    140140        bool timed_wait(
    141141            unique_lock<mutex>& m,
    142             xtime const& wait_until,predicate_type pred)
     142            xtime const& a_wait_until,predicate_type pred)
    143143        {
    144             return timed_wait(m,system_time(wait_until),pred);
     144            return timed_wait(m,system_time(a_wait_until),pred);
    145145        }
    146146
    147147        template<typename duration_type,typename predicate_type>