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 22 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 25 of file ThreadException.h.
References exception_, and lock_.
Referenced by anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::runAssembly().
|
inlineexplicitnoexcept |
|
inline |
Definition at line 31 of file ThreadException.h.
References exception_.
Referenced by ProcessLib::Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian().
|
private |
Definition at line 42 of file ThreadException.h.
Referenced by capture(), operator bool(), and rethrow().
|
private |
Definition at line 43 of file ThreadException.h.
Referenced by capture().