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
The header has #include <pthread.h> and this answer seems to indicate that I should be able to use pthreads as I normally would.
Am I missing something?
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).
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With