线程函数pthread_cleanup_push()
来源:互联网 发布:网络设计工程师 编辑:程序博客网 时间:2024/06/08 15:34
NAME
pthread_cleanup_push, pthread_cleanup_pop - establish cancellation handlers
SYNOPSIS
#include <pthread.h>void pthread_cleanup_push(void (*routine)(void*), void *arg);void pthread_cleanup_pop(int execute);
DESCRIPTION
The pthread_cleanup_push() function pushes the specified cancellation cleanup handlerroutine onto the calling thread's cancellation cleanup stack. The cancellation cleanup handler is popped from the cancellation cleanup stack and invoked with the argumentarg when: (a) the thread exits (that is, calls pthread_exit()), (b) the thread acts upon a cancellation request, or (c) the thread callspthread_cleanup_pop() with a non-zero execute argument.The pthread_cleanup_pop() function removes the routine at the top of the calling thread's cancellation cleanup stack and optionally invokes it (ifexecute is non-zero).
These functions may be implemented as macros and will appear as statements and in pairs within the same lexical scope (that is, thepthread_cleanup_push() macro may be thought to expand to a token list whose first token is`{' with pthread_cleanup_pop() expanding to a token list whose last token is the corresponding`}'.
The effect of calling longjmp() orsiglongjmp() is undefined if there have been any calls topthread_cleanup_push() or pthread_cleanup_pop() made without the matching call since the jump buffer was filled. The effect of callinglongjmp() orsiglongjmp() from inside a cancellation cleanup handler is also undefined unless the jump buffer was also filled in the cancellation cleanup handler.
RETURN VALUE
The pthread_cleanup_push() and pthread_cleanup_pop() functions return no value.
ERRORS
No errors are defined.These functions will not return an error code of [EINTR].
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
pthread_cancel(),pthread_setcancelstate(),<pthread.h>.
DERIVATION
Derived from the POSIX Threads Extension (1003.1c-1995)
- 线程函数pthread_cleanup_push()
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程清理函数pthread_cleanup_push / pthread_cleanup_pop
- 线程退出处理函数 pthread_cleanup_push pthread_cleanup_pop
- 线程清理处理函数 pthread_cleanup_push、pthread_cleanup_pop
- 线程处理函数pthread_cleanup_push / pthread_cleanup_pop (二)
- 线程的清理函数:pthread_cleanup_push / pthread_cleanup_pop
- 线程终止方式pthread_cleanup_push
- pthread_cleanup_push/pop函数使用方法
- 线程终止方式:pthread_cleanup_push/pthread_cleanup_pop()
- 线程终止方式:pthread_cleanup_push/pthread_cleanup_pop()
- pthread_cleanup_push()/pop()线程终止清理
- 关于线程加了锁未解锁和pthread_cleanup_push函数遇到的问题
- 程处理函数pthread_cleanup_push / pthread_cleanup_pop
- 第16周-任务3-电子词典
- 如何用Visual C#生成DLL文件
- GCC/G++编译过程分析
- 解决android 显示中文字符串乱码的问题
- struts2之valueStack(OGNL) (总结)
- 线程函数pthread_cleanup_push()
- 【Java】Timer和TimerTask详解
- 众多Android 开源项目推荐,给力工作给力学习
- 二、封装的变化(设计模式的核心)
- RMQ算法初学的学习总结
- linux下的framebuffer(1)
- 第16周-任务4-文档的自动处理
- Android学习记录第二篇 (layout布局)
- Facebook大跌引发市场对扎克伯格质疑