pthread_cancel可以没有发现与Android编译工具链 [英] pthread_cancel not found compiling with android toolchain

查看:1622
本文介绍了pthread_cancel可以没有发现与Android编译工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编译时使用Android工具链配​​置的程序。我使用NDK R10C。我使用由独立的工具链

I'm compiling a program that is configured using the Android Toolchain. I'm using ndk r10c. I made a standalone toolchain using

$./make-standalone-toolchain.sh --ndk-dir=/home/justin/bin/android-ndk-r10c/ --install-dir=/home/justin/android-toolchain/

和能够配置我的项目,但是当我制作我得到

and was able to configure my project, but when I make I get

error: 'pthread_cancel' was not declared in this scope

头有的#include< pthreads.h中> 这个答案似乎表明,我应该能够使用pthreads的,因为我通常会。

The header has #include <pthread.h> and this answer seems to indicate that I should be able to use pthreads as I normally would.

我缺少的东西吗?

推荐答案

仿生(Android的libc中)不具有 pthread_cancel可以。 IIRC,当我们讨论添加此我们选择不执行,因为它很容易出错,有害的性能(所有code的)。

Bionic (Android's libc) does not have pthread_cancel. IIRC, when we discussed adding this we chose not to because implementation of it is error prone and harmful to performance (of all code).

据我们所知,没有pthreads的实施实现了完全正确的 pthread_cancel可以。这也会对所有code有成本的,即使你不使用 pthread_cancel可以(因为code需要这么多的部分,可以从中断加以防护通过 pthread_cancel可以)。

As far as we could tell, no implementation of pthreads implements a fully correct pthread_cancel. It would also impose a cost on all code, even if you're not using pthread_cancel (because so many sections of code need to be guarded from interruption by pthread_cancel).

这篇关于pthread_cancel可以没有发现与Android编译工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆