|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
线程生命周期钩子 更多...
#include <thread.hpp>
Public 类型 | |
| enum class | point { before_create , after_create , thread_start , thread_end , before_destroy } |
| 钩子触发点枚举 更多... | |
| using | callback_t = void (*)(point point, id thread_id) |
| 钩子回调函数类型 | |
静态 Public 成员函数 | |
| static void | add_hook (callback_t hook) |
| 添加钩子回调 | |
| static void | remove_hook (callback_t hook) |
| 移除钩子回调 | |
| static void | invoke (point point, id thread_id) |
| 调用钩子回调 | |
|
strong |
钩子触发点枚举
| 枚举值 | |
|---|---|
| before_create | 线程创建前 |
| after_create | 线程创建后 |
| thread_start | 线程函数开始执行 |
| thread_end | 线程函数结束 |
| before_destroy | 线程对象销毁前 |
在文件 thread.hpp 第 148 行定义.
|
static |
添加钩子回调
| hook | 回调函数指针 |
|
static |
移除钩子回调
| hook | 要移除的回调函数指针 |