Closed computablee closed 11 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
e38d93a
) 99.10% compared to head (087c7bf
) 99.12%. Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which issue are you addressing?
Not an open issue, but needed to be done.
The problem was that exceptions thrown from within a
ParallelRegion
could only be caught from within theParallelRegion
, and not outside of it. This is because aThread
would terminate with an exception, which could not be caught from the main thread. This was troublesome and counter-intuitive from a programmer's perspective.How have you addressed the issue?
Creation of each thread now includes a try-catch block. If an exception is thrown from within a thread, that thread will set an exception object accessible to the main thread, then proceed to interrupt all other threads. Then, once all threads have joined, the main thread checks the exception object and, if set, will rethrow the exception, preserving the stack trace.
How have you tested your patch?
All of the
*_should_except
methods inDotMPTests
have been rewritten to have theAssert.Throws
in the outermost scope. This ensures that all exceptions can be caught from outside ofParallelRegion
s.