XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
DThd.cxx
浏览该文件的文档.
1
13#include "xwos/cxx/DThd.hxx"
14
15namespace xwos {
16
17/* Non-static Member */
18DThd::DThd(const char * name,
19 xwsz_t stack_size, xwsz_t stack_guard_size,
20 xwpr_t priority, bool detached, bool privileged)
21 : mThdDesc{nullptr, 0}
22{
23 struct xwos_thd_attr attr({
24 .name = name,
25 .stack = NULL,
26 .stack_size = stack_size,
27 .stack_guard_size = stack_guard_size,
28 .priority = priority,
29 .detached = detached,
30 .privileged = privileged,
31 });
33}
34
36{
37}
38
40{
41 return XWOK;
42}
43
44/* Static Member */
46{
47 return obj->thdMainFunction();
48}
49
50} // namespace xwos
xwos::DThd
动态线程
Definition DThd.hxx:38
xwer_t mCtorRc
Definition DThd.hxx:41
xwos_thd_d mThdDesc
Definition DThd.hxx:40
static xwer_t sThdMainFunction(DThd *thd)
Definition DThd.cxx:45
virtual xwer_t thdMainFunction()
Definition DThd.cxx:39
DThd(const char *name, xwsz_t stack_size, xwsz_t stack_guard_size=XWOS_STACK_GUARD_SIZE_DEFAULT, xwpr_t priority=XWOS_SKD_PRIORITY_RT_MIN, bool detached=false, bool privileged=true)
动态线程构造函数
Definition DThd.cxx:18
#define XWOK
No error
Definition errno.h:182
signed long xwer_t
Definition type.h:554
#define NULL
Definition type.h:28
xws32_t xwpr_t
Definition type.h:534
unsigned long xwsz_t
Definition type.h:339
xwer_t(* xwos_thd_f)(void *)
XWOS API:线程函数指针类型
Definition thd.h:144
static xwer_t xwos_thd_create(xwos_thd_d *thdd, const struct xwos_thd_attr *attr, xwos_thd_f thdfunc, void *arg)
XWOS API:使用动态申请内存方式创建线程并初始化
Definition thd.h:331
Definition Cpu.hxx:19
XWOS API:线程属性
Definition thd.h:162