Trivial cleanup of monitor code.
(The unused code was used for heap trimming in dalvikvm.)
Change-Id: I9087726629f442a54952cc0495daaa6066430141
diff --git a/src/monitor.cc b/src/monitor.cc
index 3efdab6..e3c98bb 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -252,7 +252,7 @@
void Monitor::FailedUnlock(Object* obj, Thread* expected_owner, Thread* found_owner,
Monitor* mon) {
// Acquire thread list lock so threads won't disappear from under us
- ScopedThreadListLock tll;
+ ScopedThreadListLock thread_list_lock;
// Re-read owner now that we hold lock
Thread* current_owner = mon != NULL ? mon->owner_ : NULL;
if (current_owner == NULL) {
@@ -323,7 +323,7 @@
/*
* Converts the given relative waiting time into an absolute time.
*/
-void ToAbsoluteTime(int64_t ms, int32_t ns, struct timespec *ts) {
+static void ToAbsoluteTime(int64_t ms, int32_t ns, struct timespec *ts) {
int64_t endSec;
#ifdef HAVE_TIMEDWAIT_MONOTONIC
@@ -351,18 +351,6 @@
}
}
-int dvmRelativeCondWait(pthread_cond_t* cond, pthread_mutex_t* mutex, int64_t ms, int32_t ns) {
- struct timespec ts;
- ToAbsoluteTime(ms, ns, &ts);
-#if defined(HAVE_TIMEDWAIT_MONOTONIC)
- int rc = pthread_cond_timedwait_monotonic(cond, mutex, &ts);
-#else
- int rc = pthread_cond_timedwait(cond, mutex, &ts);
-#endif
- DCHECK(rc == 0 || rc == ETIMEDOUT);
- return rc;
-}
-
/*
* Wait on a monitor until timeout, interrupt, or notification. Used for
* Object.wait() and (somewhat indirectly) Thread.sleep() and Thread.join().
diff --git a/src/monitor.h b/src/monitor.h
index a79f6ce..b949921 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -147,9 +147,6 @@
DISALLOW_COPY_AND_ASSIGN(MonitorList);
};
-// Relative timed wait on condition
-int dvmRelativeCondWait(pthread_cond_t* cond, pthread_mutex_t* mutex, int64_t msec, int32_t nsec);
-
} // namespace art
#endif // ART_SRC_MONITOR_H_