侧边栏壁纸
博主头像
noerror

虚灵不寐,众理具而万事出。

  • 累计撰写 239 篇文章
  • 累计创建 9 个标签
  • 累计收到 2 条评论
标签搜索

目 录CONTENT

文章目录

pthread_kill_other_threads_np函数用法详解

noerror
2022-10-04 / 0 评论 / 0 点赞 / 115 阅读 / 330 字 / 正在检测是否收录...

pthread_kill_other_threads_np函数用法详解

pthread_kill_other_threads_np函数简介

  • 头文件包含
#include <pthread.h>
  • 函数定义
void pthread_kill_other_threads_np(void);

pthread_kill_other_threads_np函数常见使用错误

  • 编译错误
    warning: implicit declaration of function ‘pthread_kill_other_threads_np’ [-Wimplicit-function-declaration]
    解决办法:包含头文件
#include <pthread.h>

pthread_kill_other_threads_np函数详细描述

pthread_kill_other_threads_np ()仅在LinuxThreads线程实现中有作用。在该实现中,调用此函数会立即终止应用程序中的所有线程,但调用线程除外。将忽略将要终止的线程的取消状态和取消类型,并且不在这些线程中调用清理处理程序。

pthread_kill_other_threads_np函数其他说明

pthread_kill_other_threads_np ()是要在线程调用execve (2)或类似函数之前调用的。该函数旨在解决过时的LinuxThreads实现中的一个限制,即应用程序的其他线程在execve (2)期间不会自动终止(如POSIX.1-2001所要求的)
在NPTL线程实现中,pthread_kill_other_threads_np ()存在,但不执行任何操作。(不需要做任何事情,因为实现在execve (2))期间做了正确的事情。)

0

评论区