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

ThreadInfo class doesn't contain a method to list all lock monitors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • core-svc

      Name: rmT116609 Date: 05/24/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      As Bugs 4375402 and 4593133 request there should be methods added to so that developers could provide the same output as Control-Break and Control-/ do today. In order to do that the code must provide a way to list all the lock monitors a thread holds. However, ThreadInfo only contains methods getLockName(), getLockOwnerId(), and getLockOwnerName() which appear only to list a single lock monitor. Threads can hold many lock monitors at once. Add a method to StackTraceElement like Object[] getActiveLocks() which represent the lock monitors obtained within this stack frame by the thread. That would more accurately reflect the output of Control-Break and Control-/. At least add a method to ThreadInfo like Object[] getLockMonitors() so a user could simply call that method to get all the lock monitors a thread owns.


      (Incident Review ID: 270719)
      ======================================================================
      ###@###.### 10/13/04 20:52 GMT

            mchung Mandy Chung (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: