summaryrefslogtreecommitdiff
path: root/src/mutex.cc
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2012-03-16 14:13:57 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-03-16 14:13:57 -0700
commit68d4d6728cb15ef2662965c10fa426a1c272c33f (patch)
tree282a8a995cf2c42ec326768c1270ef0e14c90df0 /src/mutex.cc
parent7ccf4f9aa37faf42a1febca43abcefa57d1bbb2a (diff)
parent76e3694db07d068d1a5e0ae7088b6f7bff6e9d43 (diff)
Merge "Clean up the trivial uses of __attribute__((unused))." into ics-mr1-plus-art
Diffstat (limited to 'src/mutex.cc')
-rw-r--r--src/mutex.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mutex.cc b/src/mutex.cc
index 01aeff495b..b3cf94639f 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -27,9 +27,8 @@
namespace art {
-static inline void CheckSafeToLockOrUnlock(MutexRank __attribute__((unused)) rank,
- bool __attribute__((unused)) is_locking) {
-#ifndef NDEBUG
+#if !defined(NDBEUG)
+static inline void CheckSafeToLockOrUnlock(MutexRank rank, bool is_locking) {
if (rank == -1) {
return;
}
@@ -37,17 +36,21 @@ static inline void CheckSafeToLockOrUnlock(MutexRank __attribute__((unused)) ran
if (self != NULL) {
self->CheckSafeToLockOrUnlock(rank, is_locking);
}
-#endif
}
+#else
+static inline void CheckSafeToLockOrUnlock(MutexRank, bool) {}
+#endif
-static inline void CheckSafeToWait(MutexRank __attribute__((unused)) rank) {
-#ifndef NDEBUG
+#if !defined(NDEBUG)
+static inline void CheckSafeToWait(MutexRank rank) {
Thread* self = Thread::Current();
if (self != NULL) {
self->CheckSafeToWait(rank);
}
-#endif
}
+#else
+static inline void CheckSafeToWait(MutexRank) {}
+#endif
Mutex::Mutex(const char* name, MutexRank rank) : name_(name), rank_(rank) {
// Like Java, we use recursive mutexes.