线程
更多...
#include <threads.hpp>
|
| Thread (bool isStartup=false) |
| 构造函数1 更多...
|
|
template<typename _Fx , typename... _ArgType> |
| Thread (bool isStartup, _Fx routine, _ArgType &&...arg) |
| 构造函数2 更多...
|
|
virtual | ~Thread () |
| 析构函数 更多...
|
|
| Thread (Thread &&other) |
| 移动构造 更多...
|
|
Thread & | operator= (Thread &&other) |
| 移动赋值 更多...
|
|
int | startup () |
| 实际创建一个线程 更多...
|
|
template<typename _Fx , typename... _ArgType> |
int | startup (_Fx routine, _ArgType &&...arg) |
| 实际创建一个线程,提供你自己的处理例程 更多...
|
|
int | startupEx (ThreadFuncPtr startRoutine, void *param) |
| 实际创建一个线程,提供你自己的处理函数 更多...
|
|
void * | joined () |
| 被调用者线程连接 更多...
|
|
int | detach () |
| 使线程分离 更多...
|
|
void | setSchedParam (SchedulePolicy policy, int priority) |
| 设置调度策略、调度参数 更多...
|
|
void | getSchedParam (SchedulePolicy *policy, int *priority) const |
| 获取调度策略、调度参数 更多...
|
|
ThreadAttr & | attr () |
| 设置线程属性对象,下次startup() 时生效 更多...
|
|
template<typename _Fx , typename... _ArgType> |
Thread & | setRunable (_Fx routine, _ArgType &&...arg) |
| 设置Runable ,run() 默认会调用它 更多...
|
|
Thread & | setDeleter (SimpleDeleterContext *deleter=NULL) |
| 设置删除器场景以便默认线程函数删除Thread 对象自己 更多...
|
|
Thread & | setDefaultDeleter () |
| 设置默认删除器场景以便默认线程函数删除Thread 对象自己 更多...
|
|
template<typename _Dt > |
Thread & | setCustomDeleter (_Dt fn) |
| 设置自定义删除器场景以便默认线程函数删除Thread 对象自己 更多...
|
|
void * | getExitVal () const |
| 取得退出值 更多...
|
|
Thread & | setExitVal (void *exitVal) |
| 设置退出值,可在run() 中调用 更多...
|
|
ThreadId | get () const |
| 线程Id 更多...
|
|
线程
在文件 threads.hpp 第 149 行定义.
typedef void*(* winux::Thread::ThreadFuncPtr) (void *param) |
winux::Thread::Thread |
( |
bool |
isStartup = false | ) |
|
|
inlineexplicit |
template<typename _Fx , typename... _ArgType>
winux::Thread::Thread |
( |
bool |
isStartup, |
|
|
_Fx |
routine, |
|
|
_ArgType &&... |
arg |
|
) |
| |
|
inlineexplicit |
virtual winux::Thread::~Thread |
( |
| ) |
|
|
virtual |
winux::Thread::Thread |
( |
Thread && |
other | ) |
|
static void winux::Thread::Exit |
( |
void * |
exitVal = NULL | ) |
|
|
static |
static void* winux::Thread::Join |
( |
Thread & |
otherThread | ) |
|
|
static |
调用者线程连接指定其他线程
退出状态由返回值或者otherThread.getExitVal()
取得
static void winux::Thread::SetConcurrency |
( |
int |
newLevel | ) |
|
|
static |
static int winux::Thread::GetConcurrency |
( |
void |
| ) |
|
|
static |
int winux::Thread::startup |
( |
| ) |
|
template<typename _Fx , typename... _ArgType>
int winux::Thread::startup |
( |
_Fx |
routine, |
|
|
_ArgType &&... |
arg |
|
) |
| |
|
inline |
int winux::Thread::startupEx |
( |
ThreadFuncPtr |
startRoutine, |
|
|
void * |
param |
|
) |
| |
void* winux::Thread::joined |
( |
| ) |
|
int winux::Thread::detach |
( |
| ) |
|
void winux::Thread::setSchedParam |
( |
SchedulePolicy |
policy, |
|
|
int |
priority |
|
) |
| |
void winux::Thread::getSchedParam |
( |
SchedulePolicy * |
policy, |
|
|
int * |
priority |
|
) |
| const |
template<typename _Fx , typename... _ArgType>
Thread& winux::Thread::setRunable |
( |
_Fx |
routine, |
|
|
_ArgType &&... |
arg |
|
) |
| |
|
inline |
Thread& winux::Thread::setDefaultDeleter |
( |
| ) |
|
|
inline |
template<typename _Dt >
Thread& winux::Thread::setCustomDeleter |
( |
_Dt |
fn | ) |
|
|
inline |
void* winux::Thread::getExitVal |
( |
| ) |
const |
|
inline |
Thread& winux::Thread::setExitVal |
( |
void * |
exitVal | ) |
|
|
inline |
virtual void winux::Thread::run |
( |
| ) |
|
|
protectedvirtual |
struct _ThreadFuncParam* winux::Thread::_param |
|
protected |
该类的文档由以下文件生成: