From 0887aee8c54d0ed51bb2031431e2bcdafebb4c6e Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:23:19 +0200 Subject: 5.13 --- zen/thread.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'zen/thread.h') diff --git a/zen/thread.h b/zen/thread.h index 43917d13..ae865cc8 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -11,7 +11,7 @@ #include //fix this pathetic boost thread warning mess -#ifdef __MINGW32__ +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-enum" #pragma GCC diagnostic ignored "-Wstrict-aliasing" @@ -24,7 +24,7 @@ #include -#ifdef __MINGW32__ +#ifdef __GNUC__ #pragma GCC diagnostic pop #endif #ifdef _MSC_VER @@ -34,8 +34,8 @@ namespace zen { /* -std::async replacement without crappy semantics: - 1. guaranteed to run asynchronous +std::async replacement without crappy semantics: + 1. guaranteed to run asynchronous 2. does not follow C++11 [futures.async], Paragraph 5, where std::future waits for thread in destructor Example: @@ -79,15 +79,6 @@ private: - - - - - - - - - //###################### implementation ###################### #ifndef BOOST_HAS_THREADS #error just some paranoia check... @@ -99,7 +90,7 @@ auto async2(Function fun) -> boost::unique_future //support for workaround of #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK //mirror "boost/thread/future.hpp", hopefully they know what they're doing boost::packaged_task pt(std::move(fun)); //packaged task seems to even require r-value reference: https://sourceforge.net/p/freefilesync/bugs/234/ #else - boost::packaged_task pt(std::move(fun)); + boost::packaged_task pt(std::move(fun)); #endif auto fut = pt.get_future(); boost::thread(std::move(pt)).detach(); //we have to explicitly detach since C++11: [thread.thread.destr] ~thread() calls std::terminate() if joinable()!!! -- cgit