- 
    Enhancement 
- 
    Resolution: Duplicate
- 
     P3 P3
- 
    None
- 
    5.0
- 
        x86
- 
        windows_xp
                    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
            
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
- duplicates
- 
                    JDK-6215270 API to detect all monitors locked/waited-on by any given thread -           
- Resolved
 
-