博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
线程函数pthread_cleanup_push()
阅读量:2240 次
发布时间:2019-05-09

本文共 1811 字,大约阅读时间需要 6 分钟。

NAME

pthread_cleanup_push, pthread_cleanup_pop - establish cancellation handlers

SYNOPSIS

#include <>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 handler
routine onto the calling thread's cancellation cleanup stack. The cancellation cleanup handler is popped from the cancellation cleanup stack and invoked with the argument
arg when: (a) the thread exits (that is, calls
), (b) the thread acts upon a cancellation request, or (c) the thread calls
pthread_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 (if execute 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, the pthread_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 or is undefined if there have been any calls to pthread_cleanup_push() or pthread_cleanup_pop() made without the matching call since the jump buffer was filled. The effect of calling or 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

,
,
.

DERIVATION

Derived from the POSIX Threads Extension (1003.1c-1995)

转载地址:http://toqbb.baihongyu.com/

你可能感兴趣的文章
内存堆与栈
查看>>
Leetcode C++《每日一题》20200621 124.二叉树的最大路径和
查看>>
Leetcode C++《每日一题》20200622 面试题 16.18. 模式匹配
查看>>
Leetcode C++《每日一题》20200625 139. 单词拆分
查看>>
Leetcode C++《每日一题》20200626 338. 比特位计数
查看>>
Leetcode C++ 《拓扑排序-1》20200626 207.课程表
查看>>
Go语言学习Part1:包、变量和函数
查看>>
Go语言学习Part2:流程控制语句:for、if、else、switch 和 defer
查看>>
Go语言学习Part3:struct、slice和映射
查看>>
Go语言学习Part4-1:方法和接口
查看>>
Leetcode Go 《精选TOP面试题》20200628 69.x的平方根
查看>>
leetcode 130. Surrounded Regions
查看>>
【Python】详解Python多线程Selenium跨浏览器测试
查看>>
Jmeter之参数化
查看>>
Shell 和Python的区别。
查看>>
【JMeter】1.9上考试jmeter测试调试
查看>>
【虫师】【selenium】参数化
查看>>
【Python练习】文件引用用户名密码登录系统
查看>>
学习网站汇总
查看>>
【Loadrunner】性能测试报告实战
查看>>