OGS
ThreadException Class Reference

Detailed Description

#include <ThreadException.h>

Public Member Functions

void capture ()
 
void rethrow ()
 

Private Attributes

std::exception_ptr exception_ = nullptr
 
std::mutex lock_
 

Member Function Documentation

◆ capture()

void ThreadException::capture ( )
inline

Definition at line 20 of file ThreadException.h.

21 {
22 std::unique_lock<std::mutex> guard{lock_};
23 exception_ = std::current_exception();
24 }
std::exception_ptr exception_

References exception_, and lock_.

Referenced by ProcessLib::Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian().

◆ rethrow()

void ThreadException::rethrow ( )
inline

Definition at line 26 of file ThreadException.h.

27 {
28 if (exception_)
29 {
30 std::rethrow_exception(exception_);
31 }
32 }

References exception_.

Referenced by ProcessLib::Assembly::ParallelVectorMatrixAssembler::assembleWithJacobian().

Member Data Documentation

◆ exception_

std::exception_ptr ThreadException::exception_ = nullptr
private

Definition at line 35 of file ThreadException.h.

Referenced by capture(), and rethrow().

◆ lock_

std::mutex ThreadException::lock_
private

Definition at line 36 of file ThreadException.h.

Referenced by capture().


The documentation for this class was generated from the following file: