Ticket #2100: boost_thread_lib_src_20100507.diff

File boost_thread_lib_src_20100507.diff, 2.3 KB (added by nstewart@…, 12 years ago)

Updated patch for boost/thread/... for pthread andwin32 handling of BOOST_NO_EXCEPTIONS, potential redefinition of WIN32_LEAN_AND_MEAN

  • win32/thread.cpp

     
    163163        {
    164164            detail::thread_data_base* const thread_info(reinterpret_cast<detail::thread_data_base*>(param));
    165165            set_current_thread_data(thread_info);
     166#ifndef BOOST_NO_EXCEPTIONS
    166167            try
     168#endif
    167169            {
    168170                thread_info->run();
    169171            }
     172#ifndef BOOST_NO_EXCEPTIONS
    170173            catch(thread_interrupted const&)
    171174            {
    172175            }
     176#endif
    173177// Removed as it stops the debugger identifying the cause of the exception
    174178// Unhandled exceptions still cause the application to terminate
    175179//             catch(...)
  • win32/tss_pe.cpp

     
    8383
    8484    #include <stdlib.h>
    8585
     86    #ifndef WIN32_LEAN_AND_MEAN
    8687    #define WIN32_LEAN_AND_MEAN
     88    #endif
     89
    8790    #include <windows.h>
    8891
    8992    //Definitions required by implementation
  • pthread/thread.cpp

     
    116116                boost::detail::thread_data_ptr thread_info = static_cast<boost::detail::thread_data_base*>(param)->self;
    117117                thread_info->self.reset();
    118118                detail::set_current_thread_data(thread_info.get());
     119#ifdef BOOST_NO_EXCEPTIONS
     120                thread_info->run();
     121#else
    119122                try
    120123                {
    121124                    thread_info->run();
     
    129132//                 {
    130133//                     std::terminate();
    131134//                 }
     135#endif
    132136
    133137                detail::tls_destructor(thread_info.get());
    134138                detail::set_current_thread_data(0);
     
    462466
    463467        void interruption_point()
    464468        {
     469#ifndef BOOST_NO_EXCEPTIONS
    465470            boost::detail::thread_data_base* const thread_info=detail::get_current_thread_data();
    466471            if(thread_info && thread_info->interrupt_enabled)
    467472            {
     
    472477                    throw thread_interrupted();
    473478                }
    474479            }
     480#endif
    475481        }
    476482       
    477483        bool interruption_enabled()