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() )
|
||||
{
|
||||
cancel();
|
||||
wait();
|
||||
try
|
||||
{
|
||||
wait();
|
||||
}
|
||||
catch (const canceled_exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -265,8 +271,14 @@ namespace fc {
|
|||
|
||||
void cancel_and_wait()
|
||||
{
|
||||
cancel();
|
||||
wait();
|
||||
cancel();
|
||||
try
|
||||
{
|
||||
wait();
|
||||
}
|
||||
catch (const canceled_exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// @pre valid()
|
||||
|
|
|
|||
Loading…
Reference in a new issue