Make future's cancel_and_wait automatically swallow the canceled_exception since it is expected.
This commit is contained in:
parent
c208a968b2
commit
24ba357b0d
1 changed files with 15 additions and 3 deletions
|
|
@ -211,7 +211,13 @@ namespace fc {
|
||||||
if( valid() )
|
if( valid() )
|
||||||
{
|
{
|
||||||
cancel();
|
cancel();
|
||||||
wait();
|
try
|
||||||
|
{
|
||||||
|
wait();
|
||||||
|
}
|
||||||
|
catch (const canceled_exception&)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,8 +271,14 @@ namespace fc {
|
||||||
|
|
||||||
void cancel_and_wait()
|
void cancel_and_wait()
|
||||||
{
|
{
|
||||||
cancel();
|
cancel();
|
||||||
wait();
|
try
|
||||||
|
{
|
||||||
|
wait();
|
||||||
|
}
|
||||||
|
catch (const canceled_exception&)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @pre valid()
|
/// @pre valid()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue