
"Peter Dimov" <pdimov@pdimov.com> writes:
Anthony Williams:
future<T> some_future;
try { throw my_exception(); }catch(...) { some_future.wait(); // may invoke task from pool if some_future // not ready throw; // oops, where's my exception state gone? }
Are you sure that the above doesn't work?
try { throw my_exception(); } catch(...) { try { call_function_that_throws(); } catch( ... ) { }
throw; // works }
No, I'm not sure, but if some_future.wait() switches to a new fiber I am concerned that it won't, because the exception state is per-thread, not per-fiber. Anthony -- Anthony Williams Author of C++ Concurrency in Action | http://www.manning.com/williams Custom Software Development | http://www.justsoftwaresolutions.co.uk Just Software Solutions Ltd, Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK