Android NDK和pthread

Android NDK和pthread,第1张

概述我正在使用 android NDK独立工具链编译Qt / C项目.我用make-standalone-toolchain.sh创建了独立工具链–arch = arm –toolchain = arm-linux-androideabi-4.9 –platform = android-21命令. NDK版本是android-ndk-r10e.目标项目使用pthread库中的一些函数.在编译时,我收到 我正在使用 android NDK独立工具链编译Qt / C项目.我用make-standalone-toolchain.sh创建了独立工具链–arch = arm –toolchain = arm-linux-androIDeabi-4.9 –platform = androID-21命令. NDK版本是androID-ndk-r10e.目标项目使用pthread库中的一些函数.在编译时,我收到以下错误:
error: 'pthread_getaffinity_np' was not declared in this scopeconst int err = pthread_getaffinity_np(_pthreadID,sizeof(cpu_set_t),&cpuSetMask);compilation terminated due to -Wfatal-errors.

我已经检查了ndk工具链中包含的pthread的标题,我没有找到pthread_getaffinity_np函数的声明.

AndroID的pthread功能是否有限?如何正确使用pthread与AndroID NDK?

解决方法 AndroID的pthread功能是否有限?

AFAIK,是的.

http://mobilepearls.com/labs/native-android-api/#pthreads

POSIX threads (pthreads)The androID libc,bionic,provIDes built-in support for pthreads,so noadditional linking (-lpthreads) is necessary. It does not implement fullPOSIX threads functionality and leaves out support for read/write locks,pthread_cancel(),process-shared mutexes and condition variables as well asother more advanced features. Read the bionic OVERVIEW.txt for moreinformation.TLS,thread-local storage,is limited to 59 pthread_key_t slots availableto applications,lower than the posix minimum of 128.
总结

以上是内存溢出为你收集整理的Android NDK和pthread全部内容,希望文章能够帮你解决Android NDK和pthread所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1136077.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存