File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ simonlep
19
19
jracle
20
20
gandziej
21
21
adish
22
+ LeonidCSIT
22
23
23
24
AutoDesk Inc.
24
25
Cyrille Fauvel (cyrillef)
Original file line number Diff line number Diff line change @@ -1997,11 +1997,16 @@ namespace details
1997
1997
}
1998
1998
catch (...)
1999
1999
{
2000
- // This exception could only have come from within the chore body. It should've been caught
2001
- // and the task should be canceled with exception. Swallow the exception here.
2002
- _ASSERTE (_HasUserException ());
2003
- if (!_HasUserException ())
2004
- _CancelWithException (std::current_exception ());
2000
+ // The exception could have come from two places:
2001
+ // 1. From the chore body, so it already should have been caught and canceled.
2002
+ // In this case swallow the exception.
2003
+ // 2. From trying to actually schedule the task on the scheduler.
2004
+ // In this case cancel the task with the current exception, otherwise the
2005
+ // task will never be signaled leading to deadlock when waiting on the task.
2006
+ if (!_HasUserException ())
2007
+ {
2008
+ _CancelWithException (std::current_exception ());
2009
+ }
2005
2010
}
2006
2011
}
2007
2012
You can’t perform that action at this time.
0 commit comments