![]() |
OGS
|
|
Initial code from https://stackoverflow.com/questions/11828539/elegant-exception-handling-in-openmp
The implementation does not guarantee, that while the exception is being checked for nullptr in the bool-conversion operator, the capture is not changing the pointer. This might lead to an exception being lost if there are two exceptions thrown simultaneously.
Definition at line 16 of file ThreadException.h.
#include <ThreadException.h>
Public Member Functions | |
| void | capture () |
| void | rethrow () |
| operator bool () const noexcept | |
Private Attributes | |
| std::exception_ptr | exception_ = nullptr |
| std::mutex | lock_ |
|
inline |
Definition at line 19 of file ThreadException.h.
References exception_, and lock_.
Referenced by anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::runAssemblyImpl().
|
inlineexplicitnoexcept |
|
inline |
Definition at line 25 of file ThreadException.h.
References exception_.
Referenced by ProcessLib::Assembly::ParallelVectorMatrixAssembler::assemble(), and ProcessLib::Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian().
|
private |
Definition at line 36 of file ThreadException.h.
Referenced by capture(), operator bool(), and rethrow().
|
private |
Definition at line 37 of file ThreadException.h.
Referenced by capture().