Ticket #13019: boost.01.interrupt-abi.patch
File boost.01.interrupt-abi.patch, 2.2 KB (added by , 5 years ago) |
---|
-
boost/thread/pthread/condition_variable_fwd.hpp
old new 32 32 class condition_variable 33 33 { 34 34 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 36 39 pthread_mutex_t internal_mutex; 37 #endif40 //#endif 38 41 pthread_cond_t cond; 39 42 40 43 public: … … 55 58 BOOST_THREAD_NO_COPYABLE(condition_variable) 56 59 condition_variable() 57 60 { 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. 59 66 int const res=pthread_mutex_init(&internal_mutex,NULL); 60 67 if(res) 61 68 { 62 69 boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in pthread_mutex_init")); 63 70 } 64 #endif71 //#endif 65 72 int const res2=pthread_cond_init(&cond,NULL); 66 73 if(res2) 67 74 { 68 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 75 //#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 76 // ditto 69 77 BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex)); 70 #endif78 //#endif 71 79 boost::throw_exception(thread_resource_error(res2, "boost::condition_variable::condition_variable() constructor failed in pthread_cond_init")); 72 80 } 73 81 } 74 82 ~condition_variable() 75 83 { 76 84 int ret; 77 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 85 //#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 86 // ditto 78 87 do { 79 88 ret = pthread_mutex_destroy(&internal_mutex); 80 89 } while (ret == EINTR); 81 90 BOOST_ASSERT(!ret); 82 #endif91 //#endif 83 92 do { 84 93 ret = pthread_cond_destroy(&cond); 85 94 } while (ret == EINTR);