summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-09-29 23:06:53 -0700
committer Ian Rogers <irogers@google.com> 2012-09-29 23:48:34 -0700
commitab47016374d340011680e9cd970ee7d6225d6704 (patch)
tree60ca0b60d34c3dc9a3158edcb81546591cc15c3c /src
parent34065b598e430c9ba3882924b544645a9b815449 (diff)
Temporarily enable futex version of ReaderWriterMutex.
To get some numbers. Also fix a bug for when self == NULL. Change-Id: I93189e74df7e01a0efd02491ea49ed371738863c
Diffstat (limited to 'src')
-rw-r--r--src/mutex.cc3
-rw-r--r--src/mutex.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mutex.cc b/src/mutex.cc
index a3aec41ca6..47ad582870 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -353,7 +353,8 @@ void ReaderWriterMutex::ExclusiveLock(Thread* self) {
android_atomic_dec(&num_pending_writers_);
}
} while(!done);
- exclusive_owner_ = static_cast<uint64_t>(self->GetTid());
+ DCHECK_EQ(state_, -1);
+ exclusive_owner_ = SafeGetTid(self);
#else
CHECK_MUTEX_CALL(pthread_rwlock_wrlock, (&rwlock_));
#endif
diff --git a/src/mutex.h b/src/mutex.h
index 1738870a57..f69eb32dbc 100644
--- a/src/mutex.h
+++ b/src/mutex.h
@@ -28,7 +28,11 @@
#include "macros.h"
#include "thread.h"
+#if defined(__APPLE__)
#define ART_USE_FUTEXES 0
+#else
+#define ART_USE_FUTEXES 1
+#endif
// Currently Darwin doesn't support locks with timeouts.
#if !defined(__APPLE__)