c - 使用 pthread_exit 终止线程,然后返回 - 奇怪的例子
问题描述
我找到了这个例子;这里两个线程 threadDefault 和 threadCustomized 通过使用 pthread_exit 然后返回来终止。为什么作者写了这两个指令?
解决方案
Mohith Reddy 的回答是正确的,但没有抓住重点。当然,return 语句永远不会执行,因为pthread_exit
它不会返回,但它会抑制来自编译器的警告,以防它不知道pthread_exit
不会返回。
推荐阅读
- facebook - 在 Facebook Graph API 中添加缺失页面权限
- c# - 我是否遵循具有这种结构的 SRP?
- python-3.x - 如何修复错误 Xlib.error.DisplayConnectionError: Can't connect to display ":0": [Errno 13] Permission denied
- git - 克隆主项目中的子模块引用问题
- jwt - Identityserver 4 API令牌验证自省端点不起作用
- django - 如何将开始和结束日期从html页面传递到views.py(django)
- flutter - 带有 Hooks 的 Riverpod 不会重建 ListView
- c++ - boost::xtime 没有名为“is_pos_infinity”的成员
- python - 使用python代码运行xml并保存为html文件
- mod - 如何修改 nfl street gamecube iso