Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4996028

Object.notify() spec use of "monitor" confusing and non-standard

XMLWordPrintable



      Name: rmT116609 Date: 02/17/2004


      A DESCRIPTION OF THE PROBLEM :
      The first sentence in the description for the notify() method in Object class says: "Wakes up a single thread that is waiting on this object's monitor." The problem with that description is that the notify() method is used in synchronized code, and synchronized code resides in the class that is the monitor itself. That description is thoroughly confusing and does not correspond with the useage of the term "monitor" by other authoritative sources (for definition of monitor, see ch. 4, High-Performance Java Platform Computing by Christopher and Thiruvathukal; p. 240, Complete Java Certification Study Guide, 3rd ed., by Heller and Roberts.)

      Same problem exists with the method notifyAll() in the same class.

      Please review the use of the term "monitor" in all other parts and later versions (like J2SE 1.4.2 and later) of the API and tutorial discussions that are related to threads.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      You tell me. How about: "Wakes up a single thread that is waiting on this object (which is likely to be the monitor)"??
      ACTUAL -
      "Wakes up a single thread that is waiting on this object's monitor."

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()
      (Incident Review ID: 232790)
      ======================================================================

            smarks Stuart Marks
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: