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
1146浏览 • 1回复 待解决
#鸿蒙学习大百科#OpenHarmony系统支持pthread库吗?
331浏览 • 1回复 待解决
是否支持<sys/epoll.h>、sys/types.h>和<unused.h>之类的头文件
2001浏览 • 1回复 待解决
HarmonyOS Web是否支持H5里使用localStorage或sessionStorage?
200浏览 • 1回复 待解决
HarmonyOS flutter与h5交互传参是否支持回调
11浏览 • 1回复 待解决
交叉编译realm-core库的时候,HarmonyOS sdk的pthread库中里没有'pthread_mutexattr_setrobust','pthread_mutex_consistent'
106浏览 • 1回复 待解决
HarmonyOS h5和原生的交互,h5页面跳转很多层,是否支持拦截H5返回手势
296浏览 • 1回复 待解决
HarmonyOS webview加载的H5页面是否支持window.localStorage
180浏览 • 1回复 待解决
HarmonyOS IJKPlayer需支持H265
175浏览 • 1回复 待解决
是否支持通过WebView跑H5 WebRTC进行音视频通话?
1185浏览 • 1回复 待解决
编译工程“undefined reference to `pthread_create'”
5922浏览 • 2回复 已解决
HarmonyOS web-rtc-V5 是否支持h265格式的视频解码
160浏览 • 1回复 待解决
HarmonyOS web-rtc-V5 是否支持h265格式的视频解码
128浏览 • 1回复 待解决
HarmonyOS Web组件是否支持修改在线h5网页的请求头
514浏览 • 1回复 待解决
HarmonyOS 是否支持flutter,不支持的话是否有支持计划
200浏览 • 1回复 待解决
在由pthread创建的线程中,如何访问raw文件
410浏览 • 1回复 待解决
pthread创建的线程中如何读取rawfile
2129浏览 • 1回复 待解决
HarmonyOS 系统是否支持通过H5地址下载或扫码安装包?
392浏览 • 1回复 待解决
HarmonyOS 是否支持webrtc
536浏览 • 1回复 待解决
是否支持增量调试,是否支持增量调试?
1104浏览 • 1回复 待解决
HarmonyOS websocket是否支持
188浏览 • 1回复 待解决
HarmonyOS 是否支持webrtc
633浏览 • 1回复 待解决
如何在C++项目中使用pthread
2318浏览 • 1回复 待解决
杀死子线程可以用pthread_cancel。但是pthread_cancel存在资源泄漏风险,所以在HarmonyOS中禁止使用pthread_cancel。HarmonyOS不支持pthread_cancel, 但是可以使用pthread_kill来规避。