NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
this_thread.hpp 文件参考

当前线程操作 更多...

#include "NeForce/core/typeinfo/type_traits.hpp"
#include "NeForce/core/config/windef.hpp"
#include <processthreadsapi.h>
#include <synchapi.h>
#include <sched.h>
#include <ctime>
this_thread.hpp 的引用(Include)关系图:

浏览该文件的源代码.

struct  cpu_times
 CPU时间信息类 更多...

函数

int64_t current_cpu () noexcept
 获取当前CPU核心编号
void yield () noexcept
 让出当前线程的时间片
void relax () noexcept
 线程放松
void sleep_for_ms (uint32_t milliseconds) noexcept
 睡眠指定毫秒数
void sleep_for_ms (uint32_t ms, bool busy_wait) noexcept
 精确睡眠指定毫秒数
void sleep_for_us (uint64_t us) noexcept
 精确睡眠指定微秒数
void sleep_for_ns (uint64_t ns) noexcept
 精确睡眠指定纳秒数
bool set_affinity (size_t cpu_mask) noexcept
 设置线程的 CPU 亲和性
bool affinity (uint64_t &affi) noexcept
 获取线程的 CPU 亲和性
bool cpu_time (cpu_times &times) noexcept
 获取当前线程的 CPU 时间
bool set_priority (int priority) noexcept
 设置线程优先级
int priority () noexcept
 获取线程优先级

详细描述

当前线程操作

此文件提供了跨平台的当前线程操作函数。

在文件 this_thread.hpp 中定义.