NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
thread_exit_notifier.hpp
1#ifndef NEFORCE_CORE_ASYNC_THREAD_EXIT_NOTIFIER_HPP__
2#define NEFORCE_CORE_ASYNC_THREAD_EXIT_NOTIFIER_HPP__
4NEFORCE_BEGIN_NAMESPACE__
5
11
17
30
38class NEFORCE_API thread_exit_notifier {
39private:
40 thread_exit_listener* tail_{nullptr};
41
42private:
43 thread_exit_notifier() noexcept = default;
44 ~thread_exit_notifier();
45
46 static thread_exit_notifier& instance() noexcept;
47
48public:
49 thread_exit_notifier(const thread_exit_notifier&) = delete;
50 thread_exit_notifier& operator=(const thread_exit_notifier&) = delete;
51
56 static void subscribe(thread_exit_listener* listener);
57
62 static void unsubscribe(thread_exit_listener* listener);
63};
64 // ThreadExit
66 // AsyncComponents
68
69NEFORCE_END_NAMESPACE__
70#endif // NEFORCE_CORE_ASYNC_THREAD_EXIT_NOTIFIER_HPP__
static void subscribe(thread_exit_listener *listener)
注册线程退出监听器
static void unsubscribe(thread_exit_listener *listener)
注销线程退出监听器
void(*)(void *) thread_exit_callback_t
线程退出回调类型
void * user_data
回调函数的用户数据
thread_exit_callback_t callback
线程退出时的回调函数
thread_exit_listener * next
监听器链表下一节点
void * chain
所属 thread_exit_notifier 指针
线程退出回调支持