OGS
ThreadException.h
Go to the documentation of this file.
1
10
#pragma once
11
12
#include <exception>
13
#include <mutex>
14
17
class
ThreadException
18
{
19
public
:
20
void
capture
()
21
{
22
std::unique_lock<std::mutex> guard{
lock_
};
23
exception_
= std::current_exception();
24
}
25
26
void
rethrow
()
27
{
28
if
(
exception_
)
29
{
30
std::rethrow_exception(
exception_
);
31
}
32
}
33
34
private
:
35
std::exception_ptr
exception_
=
nullptr
;
36
std::mutex
lock_
;
37
};
ThreadException
Definition
ThreadException.h:18
ThreadException::rethrow
void rethrow()
Definition
ThreadException.h:26
ThreadException::exception_
std::exception_ptr exception_
Definition
ThreadException.h:35
ThreadException::lock_
std::mutex lock_
Definition
ThreadException.h:36
ThreadException::capture
void capture()
Definition
ThreadException.h:20
BaseLib
ThreadException.h
Generated by
1.10.0