C++11 unexpected behavior for std::future::wait_for and std::packaged_task - by darkyh

Status : 

 


4
0
Sign in
to vote
ID 761829 Comments
Status Active Workarounds
Type Bug Repros 2
Opened 9/9/2012 10:09:42 AM
Access Restriction Public

Description

The only way to know if the result is ready without blocking in a future object is to call wait_for( std::chrono::seconds(0) ). It works using the async function but does not behave correctly with packaged_task. It returns future_status::deferred after the task is completed when it should be ready.

I'm using version 11.0.50727.1 RTM
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:32 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Stephan [MSFT] on 4/29/2013 at 5:45 PM
Hi again,

We've fixed this bug, and the fix will be available in VC12.

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Stephan [MSFT] on 3/26/2013 at 12:36 AM
Hi,

Thanks for reporting this bug. I wanted to let you know what's happening with it. I'm still keeping track of it, but it's been resolved as "Deferred" because we may not have time to fix it in VC12. (Note: VC8 = VS 2005, VC9 = VS 2008, VC10 = VS 2010, VC11 = VS 2012.)

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Pengzhen [MSFT] on 9/9/2012 at 9:42 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Microsoft Visual Studio Connect Support Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Helen [MSFT] on 9/9/2012 at 10:54 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)