Ticket #2100: boost_thread_hpp_BOOST_NO_EXCEPTIONS_20100507.diff
File boost_thread_hpp_BOOST_NO_EXCEPTIONS_20100507.diff, 3.7 KB (added by , 12 years ago) |
---|
-
thread/pthread/thread_data.hpp
79 79 80 80 void check_for_interruption() 81 81 { 82 #ifndef BOOST_NO_EXCEPTIONS 82 83 if(thread_info->interrupt_requested) 83 84 { 84 85 thread_info->interrupt_requested=false; 85 86 throw thread_interrupted(); 86 87 } 88 #endif 87 89 } 88 90 89 91 void operator=(interruption_checker&); -
thread/win32/thread_heap_alloc.hpp
75 75 inline T* heap_new() 76 76 { 77 77 void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); 78 #ifndef BOOST_NO_EXCEPTIONS 78 79 try 80 #endif 79 81 { 80 82 T* const data=new (heap_memory) T(); 81 83 return data; 82 84 } 85 #ifndef BOOST_NO_EXCEPTIONS 83 86 catch(...) 84 87 { 85 88 free_raw_heap_memory(heap_memory); 86 89 throw; 87 90 } 91 #endif 88 92 } 89 93 90 94 #ifndef BOOST_NO_RVALUE_REFERENCES … … 171 175 inline T* heap_new_impl(A1 a1,A2 a2) 172 176 { 173 177 void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); 178 #ifndef BOOST_NO_EXCEPTIONS 174 179 try 180 #endif 175 181 { 176 182 T* const data=new (heap_memory) T(a1,a2); 177 183 return data; 178 184 } 185 #ifndef BOOST_NO_EXCEPTIONS 179 186 catch(...) 180 187 { 181 188 free_raw_heap_memory(heap_memory); 182 189 throw; 183 190 } 191 #endif 184 192 } 185 193 186 194 template<typename T,typename A1,typename A2,typename A3> … … 203 211 inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4) 204 212 { 205 213 void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); 214 #ifndef BOOST_NO_EXCEPTIONS 206 215 try 216 #endif 207 217 { 208 218 T* const data=new (heap_memory) T(a1,a2,a3,a4); 209 219 return data; 210 220 } 221 #ifndef BOOST_NO_EXCEPTIONS 211 222 catch(...) 212 223 { 213 224 free_raw_heap_memory(heap_memory); 214 225 throw; 215 226 } 227 #endif 216 228 } 217 229 218 230 -
thread/win32/once.hpp
92 92 status=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&flag.status,running_value,0); 93 93 if(!status) 94 94 { 95 #ifndef BOOST_NO_EXCEPTIONS 95 96 try 97 #endif 96 98 { 97 99 if(!event_handle) 98 100 { … … 121 123 throw_count=::boost::detail::interlocked_read_acquire(&flag.throw_count); 122 124 break; 123 125 } 126 #ifndef BOOST_NO_EXCEPTIONS 124 127 catch(...) 125 128 { 126 129 if(counted) … … 138 141 } 139 142 throw; 140 143 } 144 #endif 141 145 } 142 146 143 147 if(!counted) -
thread.hpp
21 21 #include <boost/thread/locks.hpp> 22 22 #include <boost/thread/shared_mutex.hpp> 23 23 #include <boost/thread/barrier.hpp> 24 25 // boost::thread::future requires exception handling 26 // due to boost::exception::exception_ptr dependency 27 28 #ifndef BOOST_NO_EXCEPTIONS 24 29 #include <boost/thread/future.hpp> 30 #endif 25 31 26 32 #endif