Re: [v3] fix PR 54297 - segfaults with std::async

2012-08-26 Thread Jonathan Wakely
* testsuite/30_threads/async/54297.cc: Add dg-require-nanosleep. Fixed on trunk and 4.7 branch. --- a/libstdc++-v3/testsuite/30_threads/async/54297.cc +++ b/libstdc++-v3/testsuite/30_threads/async/54297.cc @@ -5,6 +5,7 @@ // { dg-require-cstdint "" } // { dg-require-gthreads "" } // {

Re: [v3] fix PR 54297 - segfaults with std::async

2012-08-26 Thread Jonathan Wakely
On 26 August 2012 15:48, H.J. Lu wrote: > On Sun, Aug 26, 2012 at 7:00 AM, Jonathan Wakely > wrote: >> On 26 August 2012 00:02, Jonathan Wakely wrote: >>> This fixes a stupid mistake I made where the functor and asynchronous >>> result can go out of scope before the async thread is joined. >>> >

Re: [v3] fix PR 54297 - segfaults with std::async

2012-08-26 Thread H.J. Lu
On Sun, Aug 26, 2012 at 7:00 AM, Jonathan Wakely wrote: > On 26 August 2012 00:02, Jonathan Wakely wrote: >> This fixes a stupid mistake I made where the functor and asynchronous >> result can go out of scope before the async thread is joined. >> >> The _Async_state_common destructor still needs t

Re: [v3] fix PR 54297 - segfaults with std::async

2012-08-26 Thread Jonathan Wakely
On 26 August 2012 00:02, Jonathan Wakely wrote: > This fixes a stupid mistake I made where the functor and asynchronous > result can go out of scope before the async thread is joined. > > The _Async_state_common destructor still needs to be exported from the > library, which is what the macro hack

[v3] fix PR 54297 - segfaults with std::async

2012-08-25 Thread Jonathan Wakely
This fixes a stupid mistake I made where the functor and asynchronous result can go out of scope before the async thread is joined. The _Async_state_common destructor still needs to be exported from the library, which is what the macro hack is for. PR libstdc++/54297 * include/std