diff options
-rw-r--r-- | runtime/base/mutex.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index cb66240..3265a13 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -30,9 +30,11 @@ namespace art { +#if defined(__APPLE__) + // This works on Mac OS 10.6 but hasn't been tested on older releases. struct __attribute__((__may_alias__)) darwin_pthread_mutex_t { - long padding0; // NOLINT(runtime/int) + long padding0; // NOLINT(runtime/int) exact match to darwin type int padding1; uint32_t padding2; int16_t padding3; @@ -43,7 +45,7 @@ struct __attribute__((__may_alias__)) darwin_pthread_mutex_t { }; struct __attribute__((__may_alias__)) darwin_pthread_rwlock_t { - long padding0; // NOLINT(runtime/int) + long padding0; // NOLINT(runtime/int) exact match to darwin type pthread_mutex_t padding1; int padding2; pthread_cond_t padding3; @@ -54,6 +56,10 @@ struct __attribute__((__may_alias__)) darwin_pthread_rwlock_t { // ...other stuff we don't care about. }; +#endif // __APPLE__ + +#if defined(__GLIBC__) + struct __attribute__((__may_alias__)) glibc_pthread_mutex_t { int32_t padding0[2]; int owner; @@ -70,6 +76,8 @@ struct __attribute__((__may_alias__)) glibc_pthread_rwlock_t { // ...other stuff we don't care about. }; +#endif // __GLIBC__ + #if ART_USE_FUTEXES static bool ComputeRelativeTimeSpec(timespec* result_ts, const timespec& lhs, const timespec& rhs) { const int32_t one_sec = 1000 * 1000 * 1000; // one second in nanoseconds. |