summaryrefslogtreecommitdiffstats
path: root/runtime/base
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-07-19 00:31:07 -0700
committerBrian Carlstrom <bdc@google.com>2013-07-19 00:31:07 -0700
commit6eb5288264d68276085855bd041fa74fbca6827c (patch)
tree8ac3d0a3667adaa260d70a14a4935bd22b1e7f97 /runtime/base
parentf52935278fca8c7aa220543eef4544e3d1105d91 (diff)
downloadart-6eb5288264d68276085855bd041fa74fbca6827c.zip
art-6eb5288264d68276085855bd041fa74fbca6827c.tar.gz
art-6eb5288264d68276085855bd041fa74fbca6827c.tar.bz2
Conditionally define non-Android pthread structures
Change-Id: I2258b521db20dcc6940cb5540ca24ea5bbaf006f
Diffstat (limited to 'runtime/base')
-rw-r--r--runtime/base/mutex.cc12
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.