diff options
| author | 2012-09-29 23:06:53 -0700 | |
|---|---|---|
| committer | 2012-09-29 23:48:34 -0700 | |
| commit | ab47016374d340011680e9cd970ee7d6225d6704 (patch) | |
| tree | 60ca0b60d34c3dc9a3158edcb81546591cc15c3c /src | |
| parent | 34065b598e430c9ba3882924b544645a9b815449 (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.cc | 3 | ||||
| -rw-r--r-- | src/mutex.h | 4 |
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__) |