Re: std::packaged_task trunk problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux