This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: std::packaged_task trunk problem
On Wed, Nov 2, 2011 at 01:56, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> 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();
Ok. Thanks, that work fine.
Now of to next problem on how to store a std::packaged_task in a container.
--
    Lgb