diff options
author | Ian Rogers <irogers@google.com> | 2014-08-15 13:39:34 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-08-15 13:39:34 -0700 |
commit | 0ef3bd2a2334c0825130501bbabf6cbc8e870582 (patch) | |
tree | f287b2083ab3ef63541def6f7de42e0ea4740c92 /runtime/monitor.cc | |
parent | ee736b29675455ab0be615581145aa239ce7a6b3 (diff) | |
download | art-0ef3bd2a2334c0825130501bbabf6cbc8e870582.tar.gz art-0ef3bd2a2334c0825130501bbabf6cbc8e870582.tar.bz2 art-0ef3bd2a2334c0825130501bbabf6cbc8e870582.zip |
Tidy up monitor comments.
Change-Id: Ib9d993f964ba6e2bec1979b486c26d3920a4a40c
Diffstat (limited to 'runtime/monitor.cc')
-rw-r--r-- | runtime/monitor.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 4c780ee9e6..8f5ae54d89 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -176,10 +176,6 @@ Monitor::~Monitor() { // Deflated monitors have a null object. } -/* - * Links a thread into a monitor's wait set. The monitor lock must be - * held by the caller of this routine. - */ void Monitor::AppendToWaitSet(Thread* thread) { DCHECK(owner_ == Thread::Current()); DCHECK(thread != NULL); @@ -197,10 +193,6 @@ void Monitor::AppendToWaitSet(Thread* thread) { t->SetWaitNext(thread); } -/* - * Unlinks a thread from a monitor's wait set. The monitor lock must - * be held by the caller of this routine. - */ void Monitor::RemoveFromWaitSet(Thread *thread) { DCHECK(owner_ == Thread::Current()); DCHECK(thread != NULL); @@ -395,29 +387,6 @@ bool Monitor::Unlock(Thread* self) { return true; } -/* - * Wait on a monitor until timeout, interrupt, or notification. Used for - * Object.wait() and (somewhat indirectly) Thread.sleep() and Thread.join(). - * - * If another thread calls Thread.interrupt(), we throw InterruptedException - * and return immediately if one of the following are true: - * - blocked in wait(), wait(long), or wait(long, int) methods of Object - * - blocked in join(), join(long), or join(long, int) methods of Thread - * - blocked in sleep(long), or sleep(long, int) methods of Thread - * Otherwise, we set the "interrupted" flag. - * - * Checks to make sure that "ns" is in the range 0-999999 - * (i.e. fractions of a millisecond) and throws the appropriate - * exception if it isn't. - * - * The spec allows "spurious wakeups", and recommends that all code using - * Object.wait() do so in a loop. This appears to derive from concerns - * about pthread_cond_wait() on multiprocessor systems. Some commentary - * on the web casts doubt on whether these can/should occur. - * - * Since we're allowed to wake up "early", we clamp extremely long durations - * to return at the end of the 32-bit time epoch. - */ void Monitor::Wait(Thread* self, int64_t ms, int32_t ns, bool interruptShouldThrow, ThreadState why) { DCHECK(self != NULL); @@ -818,9 +787,6 @@ bool Monitor::MonitorExit(Thread* self, mirror::Object* obj) { } } -/* - * Object.wait(). Also called for class init. - */ void Monitor::Wait(Thread* self, mirror::Object *obj, int64_t ms, int32_t ns, bool interruptShouldThrow, ThreadState why) { DCHECK(self != nullptr); |