getcontext makecontext setcontext swapcontext
来源:互联网 发布:美图里的蜡笔软件 编辑:程序博客网 时间:2024/06/07 23:31
getcontext makecontext setcontext swapcontext
允许在一个程序中多个线程进行切换.
typedef struct ucontext { struct ucontext *uc_link; // 当前 thread 运行完后, 接着运行 uc_link sigset_t uc_sigmask; // 阻塞的信号集 stack_t uc_stack; // current context use stack mcontext_t uc_mcontext; // thread's machine register }
getcontext(ucontext *ucp)
: 初始化一个 context currently active context
setcontext
: 恢复一个 context.
- 如果 context 是从getcontext获得,那么程序继续执行.
- 如果 context 是从makecontext获得, 先执行 func 然后执行 uc_link.
context 从 signal handler 获得, 那么行为未确定.
makecontext(ucontext_t *ucp, void (*func)(), int argc, ...)
: 用于修改 context(obtain from a call to getcontext), 使用 setcontext swapcontext activate, 先执行func, 然后执行 ucp->uclink(if ucp->uclink pointer is NULL, the thread exits),swapcontext(ucontext_t *oucp, ucontext_t *ucp)
: 保存当前 context, activated ucp
0 0
- getcontext makecontext setcontext swapcontext
- setcontext getcontext makecontext swapcontext
- 使用makecontext实现用户线程
- 使用makecontext实现用户线程
- ActionContext.getContext()
- pjf获得SwapContext地址方法的解析
- 自己实现SwapContext,接管线程切换
- swipeListView.getContext().getResources().getInteger
- ActionContext.getContext()详解
- IE支持getContext
- getContext(), getApplicationContext(), getBaseContext()区别
- actioncontext.getcontext()详解
- ActionContext.getContext()用法
- ActionContext.getContext()的用法
- 关于ActionContext.getContext()
- 认识((Activity)getContext()).finish()
- getContext,this,getApplicationContext区别
- (Activity) getContext()报错
- Android 搭建Junit测试环境
- DPM(Defomable Parts Model) 源码分析-检测(二)
- 谈单元测试的状态验证和行为验证
- 【WiFi密码破解详细图文教程】ZOL仅此一份 详细介绍从CDlinux U盘启动到设置扫描破解
- Heritrix —— eclipse 安装与配置
- getcontext makecontext setcontext swapcontext
- poj 2773 Happy 2006(容斥原理)
- hdu 4503 湫湫系列故事——植树节
- DPM(Defomable Parts Model) 源码分析-训练(三)
- 第一个struts2工程需要注意的地方
- android权限大全
- 全面了解Android开发规范
- 瓜子脸女生适合的发型 齐肩发显魅力
- 黑马程序员---正则表达式