BUG with std::async ? - by frank__y

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 742856 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 5/20/2012 7:33:09 PM
Access Restriction Public
Moderator Decision Sent to Engineering Team for consideration

Description

I want to catch exception from async. Shouldn't get() call wait() internal ?  Does i need call wait() explicit before get()?


#include <future>
#include <iostream>
#include <exception>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	auto f = async( []{throw exception("err") ; });
	try{
		// f.wait(); // Can't catch exception if comment this line. Is it a BUG ???
		f.get();		
	}
	catch(const exception& e){ cout << "catched: " << e.what() << endl; }
	

	cin.get();
	return 0;
}
Sign in to post a comment.
Posted by Microsoft on 5/29/2012 at 8:10 PM
Hi,

Thanks for reporting this bug. We've already fixed it, and the fix will be available in VC11 RTM.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by MS-Moderator10 [Feedback Moderator] on 5/21/2012 at 3:24 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 5/20/2012 at 7:43 PM
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)