Ticket #13019: boost.01.interrupt-abi.patch

File boost.01.interrupt-abi.patch, 2.2 KB (added by David Linden <david.linden@…>, 5 years ago)
  • boost/thread/pthread/condition_variable_fwd.hpp

    old new  
    3232    class condition_variable
    3333    {
    3434    private:
    35 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     35
     36//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     37        // This data must be present so that with-and-without
     38        // interrupts the structure is the same for ABI compatibility
    3639        pthread_mutex_t internal_mutex;
    37 #endif
     40//#endif
    3841        pthread_cond_t cond;
    3942
    4043    public:
     
    5558      BOOST_THREAD_NO_COPYABLE(condition_variable)
    5659        condition_variable()
    5760        {
    58 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     61//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     62            // Even if it is not used, the internal_mutex exists (see
     63            // above) and must be initialized (etc) in case some
     64            // compilation units provide interruptions and others
     65            // don't.
    5966            int const res=pthread_mutex_init(&internal_mutex,NULL);
    6067            if(res)
    6168            {
    6269                boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in pthread_mutex_init"));
    6370            }
    64 #endif
     71//#endif
    6572            int const res2=pthread_cond_init(&cond,NULL);
    6673            if(res2)
    6774            {
    68 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     75//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     76                // ditto
    6977                BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
    70 #endif
     78//#endif
    7179                boost::throw_exception(thread_resource_error(res2, "boost::condition_variable::condition_variable() constructor failed in pthread_cond_init"));
    7280            }
    7381        }
    7482        ~condition_variable()
    7583        {
    7684            int ret;
    77 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     85//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
     86            // ditto
    7887            do {
    7988              ret = pthread_mutex_destroy(&internal_mutex);
    8089            } while (ret == EINTR);
    8190            BOOST_ASSERT(!ret);
    82 #endif
     91//#endif
    8392            do {
    8493              ret = pthread_cond_destroy(&cond);
    8594            } while (ret == EINTR);