HarmonyOS是否支持pthread.h
使用的第三方c++库使用了pthread.h,代码如下:
#include <pthread.h>
int unsafe_exit() const {
#ifdef ANDROID
struct sigaction actions;
memset(&actions, 0, sizeof(actions));
sigemptyset(&actions.sa_mask);
actions.sa_flags = 0;
actions.sa_handler = &exit_handler;
sigaction(SIGUSR2, &actions, NULL);
ASSERT2(false, " use SIGUSR2(handler call pthread_exit) to pthread_cancel");
return kill(SIGUSR2);
#else
return pthread_cancel(tid());
#endif
编译的时候出现错误:
/mnt/c/harmony_project/harmonyf3cftlog/Proj/HarmonyOS/FTLog/cpp/../../../../Src/mars/comm/thread/../unix/thread/thread.h:327:16: error: use of undeclared identifier 'pthread_cancel'
return pthread_cancel(tid());
^
1 error generated.
请问如何解决?
HarmonyOS
赞
收藏 0
回答 1
待解决
相关问题
当前不支持pthread_mutexattr_setrobust、pthread_mutex_consistent
1743浏览 • 1回复 待解决
是否支持<sys/epoll.h>、sys/types.h>和<unused.h>之类的头文件
2535浏览 • 1回复 待解决
HarmonyOS Web是否支持H5里使用localStorage或sessionStorage?
1308浏览 • 1回复 待解决
#鸿蒙学习大百科#OpenHarmony系统支持pthread库吗?
1341浏览 • 1回复 待解决
HarmonyOS flutter与h5交互传参是否支持回调
1027浏览 • 1回复 待解决
HarmonyOS webview加载的H5页面是否支持window.localStorage
1197浏览 • 1回复 待解决
HarmonyOS IJKPlayer需支持H265
893浏览 • 1回复 待解决
HarmonyOS h5和原生的交互,h5页面跳转很多层,是否支持拦截H5返回手势
1377浏览 • 1回复 待解决
是否支持通过WebView跑H5 WebRTC进行音视频通话?
2064浏览 • 1回复 待解决
HarmonyOS Web组件是否支持修改在线h5网页的请求头
1148浏览 • 1回复 待解决
HarmonyOS 是否支持flutter,不支持的话是否有支持计划
1063浏览 • 1回复 待解决
交叉编译realm-core库的时候,HarmonyOS sdk的pthread库中里没有'pthread_mutexattr_setrobust','pthread_mutex_consistent'
2045浏览 • 3回复 待解决
HarmonyOS web-rtc-V5 是否支持h265格式的视频解码
893浏览 • 1回复 待解决
HarmonyOS web-rtc-V5 是否支持h265格式的视频解码
804浏览 • 1回复 待解决
编译工程“undefined reference to `pthread_create'”
6749浏览 • 2回复 已解决
HarmonyOS 系统是否支持通过H5地址下载或扫码安装包?
2041浏览 • 1回复 待解决
HarmonyOS websocket是否支持
1052浏览 • 1回复 待解决
HarmonyOS 是否支持webrtc
1398浏览 • 1回复 待解决
pthread创建的线程中如何读取rawfile
2904浏览 • 1回复 待解决
是否支持增量调试,是否支持增量调试?
2013浏览 • 1回复 待解决
HarmonyOS 是否支持webrtc
1324浏览 • 1回复 待解决
HarmonyOS webview是否支持webrtc
1038浏览 • 1回复 待解决
HarmonyOS是否支持消息推送?
3045浏览 • 1回复 待解决
杀死子线程可以用pthread_cancel。但是pthread_cancel存在资源泄漏风险,所以在HarmonyOS中禁止使用pthread_cancel。HarmonyOS不支持pthread_cancel, 但是可以使用pthread_kill来规避。