JDK-6358247 : No way to get all locked monitors and locked synchronizers in one snapshot
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-02
  • Updated: 2017-05-16
  • Resolved: 2006-01-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b67Fixed
Related Reports
Relates :  
Description
The getAllLockedMonitors and getAllLockedSynchronizers are two separate methods.  They return different snapshots of all locked monitors and locked synchronizers.

Need a way to return all locked monitors and locked synchronizers in one snapshot like what control-break prints out.

Comments
EVALUATION The final spec is: public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers); A convenient method to get thread dump of all live threads remotely in one single operation: public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers);
03-01-2006

EVALUATION The proposed solution is to replace getAllLockedMonitors and getAllLockedSynchronizers with: public ThreadInfo[] getAllThreadInfos(boolean lockedMonitors, boolean lockedSynchronizers); Add two methods in ThreadInfo class: public MonitorInfo[] getLockedMonitors(); public LockInfo[] getLockedSynchronizers();
02-12-2005

EVALUATION getAllLockedMonitors and getAllLockedSynchronizers are designed for diagnosing synchronization problem. Object monitors and ownable synchronizers are two separate synchronization mechanisms. Thus obtaining a snapshot of all locked monitors or all locked synchronizers would suffice to diagnose object monitors related problem or synchronizers related problem respectively. There are times that you would want to look at what object monitors and synchronizers are locked by a thread and it would be useful. We will fix this in Mustang.
02-12-2005