31 lines
682 B
C++
31 lines
682 B
C++
/**
|
|
* @file exception_mt.h
|
|
* @brief 多线程异常处理
|
|
* @author Cat (null.null.null@qq.com)
|
|
* @version 0.1
|
|
* @date 2021-09-24
|
|
*
|
|
* Copyright: Baosight Co. Ltd.
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "mix_cc/exception/exception.h"
|
|
#include <optional>
|
|
#include <thread>
|
|
namespace mix_cc {
|
|
|
|
/**
|
|
* @brief 把异常信息存储在全局存储中
|
|
* @param e My Param doc
|
|
*/
|
|
void storage_exception_mt(std::exception e, std::thread::id tid);
|
|
|
|
/**
|
|
* @brief 从全局存储获取异常
|
|
* @return std::optional<mix_cc::Exception>
|
|
*/
|
|
std::optional<std::exception> receive_exception_mt(std::thread::id tid);
|
|
|
|
} // namespace mix_cc
|