Temporarily enable futex version of ReaderWriterMutex.
To get some numbers.
Also fix a bug for when self == NULL.
Change-Id: I93189e74df7e01a0efd02491ea49ed371738863c
diff --git a/src/mutex.cc b/src/mutex.cc
index a3aec41..47ad582 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -353,7 +353,8 @@
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 1738870..f69eb32 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__)