1#ifndef NEFORCE_CORE_ASYNC_THREAD_TRACKER_HPP__
2#define NEFORCE_CORE_ASYNC_THREAD_TRACKER_HPP__
12NEFORCE_BEGIN_NAMESPACE__
40 static NEFORCE_ALWAYS_INLINE
void on_thread_create()
noexcept { ++count_; }
42 static NEFORCE_ALWAYS_INLINE
void on_thread_destroy()
noexcept { --count_; }
60 static thread_tracker tracker;
98NEFORCE_END_NAMESPACE__
static thread_tracker & instance() noexcept
获取线程跟踪器单例实例
static NEFORCE_ALWAYS_INLINE int thread_count() noexcept
获取当前活动线程数量
static NEFORCE_ALWAYS_INLINE bool is_single_threaded() noexcept
检查是否处于单线程模式
NEFORCE_ALWAYS_INLINE_INLINE int thread_count() noexcept
获取当前活动线程数量
NEFORCE_ALWAYS_INLINE_INLINE bool is_single_threaded() noexcept
检查当前是否处于单线程模式
T load(const memory_order mo=memory_order_seq_cst) const noexcept
原子加载操作