am d40eb159: Merge "Fix some pthread symbols build as C++ symbol under x64 lunch."

* commit 'd40eb1594dff0103247292967f8a801ef8c0ff12':
  Fix some pthread symbols build as C++ symbol under x64 lunch.
This commit is contained in:
Elliott Hughes 2014-03-07 01:27:38 +00:00 committed by Android Git Automerger
commit 3748694064
2 changed files with 8 additions and 5 deletions

View File

@ -94,18 +94,21 @@ int pthread_attr_getstacksize(const pthread_attr_t* attr, size_t* stack_size) {
return 0;
}
int pthread_attr_setstackaddr(pthread_attr_t*, void*) {
#if !defined(__LP64__)
// TODO: this exists only for backward binary compatibility on 32 bit platforms.
extern "C" int pthread_attr_setstackaddr(pthread_attr_t*, void*) {
// This was removed from POSIX.1-2008, and is not implemented on bionic.
// Needed for ABI compatibility with the NDK.
return ENOSYS;
}
int pthread_attr_getstackaddr(const pthread_attr_t* attr, void** stack_addr) {
extern "C" int pthread_attr_getstackaddr(const pthread_attr_t* attr, void** stack_addr) {
// This was removed from POSIX.1-2008.
// Needed for ABI compatibility with the NDK.
*stack_addr = (char*)attr->stack_base + attr->stack_size;
return 0;
}
#endif // !defined(__LP64__)
int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_size) {
if ((stack_size & (PAGE_SIZE - 1) || stack_size < PTHREAD_STACK_MIN)) {

View File

@ -206,14 +206,14 @@ extern "C" int pthread_cond_timedwait_monotonic(pthread_cond_t* cond, pthread_mu
extern "C" int pthread_cond_timedwait_monotonic_np(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* abstime) {
return __pthread_cond_timedwait(cond, mutex, abstime, CLOCK_MONOTONIC);
}
#endif // !defined(__LP64__)
int pthread_cond_timedwait_relative_np(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* reltime) {
extern "C" int pthread_cond_timedwait_relative_np(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* reltime) {
return __pthread_cond_timedwait_relative(cond, mutex, reltime);
}
int pthread_cond_timeout_np(pthread_cond_t* cond, pthread_mutex_t* mutex, unsigned ms) {
extern "C" int pthread_cond_timeout_np(pthread_cond_t* cond, pthread_mutex_t* mutex, unsigned ms) {
timespec ts;
timespec_from_ms(ts, ms);
return __pthread_cond_timedwait_relative(cond, mutex, &ts);
}
#endif // !defined(__LP64__)