Ticket #8458: 8458.2.patch
File 8458.2.patch, 7.6 KB (added by , 9 years ago) |
---|
-
boost/thread/detail/thread.hpp
157 157 #endif 158 158 } 159 159 160 class BOOST_THREAD_DECLthread160 class thread 161 161 { 162 162 public: 163 163 typedef thread_attributes attributes; … … 167 167 168 168 struct dummy; 169 169 170 void release_handle();170 BOOST_THREAD_DECL void release_handle(); 171 171 172 172 detail::thread_data_ptr thread_info; 173 173 174 174 private: 175 bool start_thread_noexcept();176 bool start_thread_noexcept(const attributes& attr);175 BOOST_THREAD_DECL bool start_thread_noexcept(); 176 BOOST_THREAD_DECL bool start_thread_noexcept(const attributes& attr); 177 177 public: 178 178 void start_thread() 179 179 { … … 190 190 } 191 191 } 192 192 193 explicit thread(detail::thread_data_ptr data);193 BOOST_THREAD_DECL explicit thread(detail::thread_data_ptr data); 194 194 195 detail::thread_data_ptr get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const;195 BOOST_THREAD_DECL detail::thread_data_ptr get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const; 196 196 197 197 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 198 198 #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) … … 243 243 thread(const volatile thread&); 244 244 #endif 245 245 #endif 246 thread() BOOST_NOEXCEPT;246 BOOST_THREAD_DECL thread() BOOST_NOEXCEPT; 247 247 ~thread() 248 248 { 249 249 … … 459 459 #endif 460 460 461 461 462 bool joinable() const BOOST_NOEXCEPT;462 BOOST_THREAD_DECL bool joinable() const BOOST_NOEXCEPT; 463 463 private: 464 bool join_noexcept();464 BOOST_THREAD_DECL bool join_noexcept(); 465 465 public: 466 466 inline void join(); 467 467 … … 494 494 #endif 495 495 #if defined(BOOST_THREAD_PLATFORM_WIN32) 496 496 private: 497 bool do_try_join_until_noexcept(uintmax_t milli, bool& res);497 BOOST_THREAD_DECL bool do_try_join_until_noexcept(uintmax_t milli, bool& res); 498 498 inline bool do_try_join_until(uintmax_t milli); 499 499 public: 500 bool timed_join(const system_time& abs_time);500 BOOST_THREAD_DECL bool timed_join(const system_time& abs_time); 501 501 //{ 502 502 // return do_try_join_until(get_milliseconds_until(wait_until)); 503 503 //} … … 543 543 return timed_join(get_system_time()+rel_time); 544 544 } 545 545 #endif 546 void detach();546 BOOST_THREAD_DECL void detach(); 547 547 548 static unsigned hardware_concurrency() BOOST_NOEXCEPT;548 BOOST_THREAD_DECL static unsigned hardware_concurrency() BOOST_NOEXCEPT; 549 549 550 550 #define BOOST_THREAD_DEFINES_THREAD_NATIVE_HANDLE 551 551 typedef detail::thread_data_base::native_handle_type native_handle_type; 552 native_handle_type native_handle();552 BOOST_THREAD_DECL native_handle_type native_handle(); 553 553 554 554 #if defined BOOST_THREAD_PROVIDES_THREAD_EQ 555 555 // Use thread::id when comparisions are needed … … 571 571 572 572 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 573 573 // extensions 574 void interrupt();575 bool interruption_requested() const BOOST_NOEXCEPT;574 BOOST_THREAD_DECL void interrupt(); 575 BOOST_THREAD_DECL bool interruption_requested() const BOOST_NOEXCEPT; 576 576 #endif 577 577 }; 578 578 … … 595 595 #ifdef BOOST_THREAD_PLATFORM_PTHREAD 596 596 inline thread::id get_id() BOOST_NOEXCEPT; 597 597 #else 598 thread::id BOOST_THREAD_DECL get_id() BOOST_NOEXCEPT;598 BOOST_THREAD_DECL thread::id BOOST_THREAD_DECL get_id() BOOST_NOEXCEPT; 599 599 #endif 600 600 601 601 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS -
libs/thread/src/win32/thread.cpp
230 230 } 231 231 } 232 232 233 thread::thread() BOOST_NOEXCEPT233 BOOST_THREAD_DECL thread::thread() BOOST_NOEXCEPT 234 234 {} 235 235 236 bool thread::start_thread_noexcept()236 BOOST_THREAD_DECL bool thread::start_thread_noexcept() 237 237 { 238 238 uintptr_t const new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id); 239 239 if(!new_thread) … … 247 247 return true; 248 248 } 249 249 250 bool thread::start_thread_noexcept(const attributes& attr)250 BOOST_THREAD_DECL bool thread::start_thread_noexcept(const attributes& attr) 251 251 { 252 252 //uintptr_t const new_thread=_beginthreadex(attr.get_security(),attr.get_stack_size(),&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id); 253 253 uintptr_t const new_thread=_beginthreadex(0,static_cast<unsigned int>(attr.get_stack_size()),&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id); … … 262 262 return true; 263 263 } 264 264 265 thread::thread(detail::thread_data_ptr data):265 BOOST_THREAD_DECL thread::thread(detail::thread_data_ptr data): 266 266 thread_info(data) 267 267 {} 268 268 … … 317 317 318 318 } 319 319 320 thread::id thread::get_id() const BOOST_NOEXCEPT320 BOOST_THREAD_DECL thread::id thread::get_id() const BOOST_NOEXCEPT 321 321 { 322 322 #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID 323 323 detail::thread_data_ptr local_thread_info=(get_thread_info)(); … … 328 328 #endif 329 329 } 330 330 331 bool thread::joinable() const BOOST_NOEXCEPT331 BOOST_THREAD_DECL bool thread::joinable() const BOOST_NOEXCEPT 332 332 { 333 333 return (get_thread_info)() ? true : false; 334 334 } 335 bool thread::join_noexcept()335 BOOST_THREAD_DECL bool thread::join_noexcept() 336 336 { 337 337 338 338 detail::thread_data_ptr local_thread_info=(get_thread_info)(); … … 349 349 } 350 350 351 351 #if defined BOOST_THREAD_USES_DATETIME 352 bool thread::timed_join(boost::system_time const& wait_until)352 BOOST_THREAD_DECL bool thread::timed_join(boost::system_time const& wait_until) 353 353 { 354 354 return do_try_join_until(get_milliseconds_until(wait_until)); 355 355 } 356 356 #endif 357 bool thread::do_try_join_until_noexcept(uintmax_t milli, bool& res)357 BOOST_THREAD_DECL bool thread::do_try_join_until_noexcept(uintmax_t milli, bool& res) 358 358 { 359 359 detail::thread_data_ptr local_thread_info=(get_thread_info)(); 360 360 if(local_thread_info) … … 385 385 } 386 386 387 387 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS 388 void thread::interrupt()388 BOOST_THREAD_DECL void thread::interrupt() 389 389 { 390 390 detail::thread_data_ptr local_thread_info=(get_thread_info)(); 391 391 if(local_thread_info) … … 394 394 } 395 395 } 396 396 397 bool thread::interruption_requested() const BOOST_NOEXCEPT397 BOOST_THREAD_DECL bool thread::interruption_requested() const BOOST_NOEXCEPT 398 398 { 399 399 detail::thread_data_ptr local_thread_info=(get_thread_info)(); 400 400 return local_thread_info.get() && (detail::win32::WaitForSingleObject(local_thread_info->interruption_handle,0)==0); 401 401 } 402 402 403 unsigned thread::hardware_concurrency() BOOST_NOEXCEPT403 BOOST_THREAD_DECL unsigned thread::hardware_concurrency() BOOST_NOEXCEPT 404 404 { 405 405 //SYSTEM_INFO info={{0}}; 406 406 SYSTEM_INFO info; … … 409 409 } 410 410 #endif 411 411 412 thread::native_handle_type thread::native_handle()412 BOOST_THREAD_DECL thread::native_handle_type thread::native_handle() 413 413 { 414 414 detail::thread_data_ptr local_thread_info=(get_thread_info)(); 415 415 return local_thread_info?(detail::win32::handle)local_thread_info->thread_handle:detail::win32::invalid_handle_value; 416 416 } 417 417 418 detail::thread_data_ptr thread::get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const418 BOOST_THREAD_DECL detail::thread_data_ptr thread::get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const 419 419 { 420 420 return thread_info; 421 421 }