This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::packaged_task trunk problem


On 1 November 2011 15:12, Lars Gullik Bjønnes wrote:
>>
>> Aha, this is http://lwg.github.com/issues/lwg-active.html#2067
>>
>> Although it's only in READY status I'll apply the fix to libstdc++ tonight.
>
> Thanks a lot for having a look at this.

I've fixed it in the svn trunk by implementing LWG 2067, and working
around some new issues I found in <future>.

N.B. your example is still broken, because the std::thread is not
explicitly joined or detached so will call std::terminate in its
destructor.  That's due to a change to std::thread that was made after
the packaged_task paper you got the example from.  It can be fixed by
detaching the thread (which is safe in this specific case because the
thread doesn't refer to anything that will go out of scope before it
finishes):

  std::thread(std::move(task)).detach();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]