Reputation: 1012
I'm trying to parallelize an algorithm in C on Android NDK with pthreads.
Up to now everything worked quite good. To optimize my code, i tried to use pthread_barrier_t
.
But when i try to compile it with ndk-build, this error message appears:
jni/singleFFT.c:6:1: error: unknown type name 'pthread_barrier_t'
Everything else works good. Creating pthreads and joining them... but just trying to add a pthread_barrier_t causes this error. (pthread.h is included)
Is the pthread_barrier_t not supported on Android or what do i need to do? Perhaps a flag in the Android.mk?
Upvotes: 2
Views: 1670
Reputation: 3135
The Bionic libc doesn't provide Barriers synchronization primitive (pthread_barrier_t
type and related functions) in Android NDK.
https://github.com/android/platform_bionic/blob/master/libc/include/pthread.h
Upvotes: 3