Make Monitor::Wait more robust to spurious Inflate failures.

Bug: 17062710
Change-Id: Ife5f6b335caacc70cab543cd568676d277d3beb6
(cherry picked from commit 6f22fc166ed6c11cad229bff442c064e704de101)
diff --git a/runtime/monitor.h b/runtime/monitor.h
index 26d43c9..ae14fc1 100644
--- a/runtime/monitor.h
+++ b/runtime/monitor.h
@@ -117,6 +117,7 @@
     return monitor_id_;
   }
 
+  // Inflate the lock on obj. May fail to inflate for spurious reasons, always re-check.
   static void InflateThinLocked(Thread* self, Handle<mirror::Object> obj, LockWord lock_word,
                                 uint32_t hash_code) NO_THREAD_SAFETY_ANALYSIS;
 
@@ -138,6 +139,12 @@
   void AppendToWaitSet(Thread* thread) EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_);
   void RemoveFromWaitSet(Thread* thread) EXCLUSIVE_LOCKS_REQUIRED(monitor_lock_);
 
+  /*
+   * Changes the shape of a monitor from thin to fat, preserving the internal lock state. The
+   * calling thread must own the lock or the owner must be suspended. There's a race with other
+   * threads inflating the lock, installing hash codes and spurious failures. The caller should
+   * re-read the lock word following the call.
+   */
   static void Inflate(Thread* self, Thread* owner, mirror::Object* obj, int32_t hash_code)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);