From a850dd23822bd7a67e1f660f2cd056ea29852a81 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Mon, 25 Dec 2006 23:58:51 +0000 Subject: 2006-12-25 Andrew John Hughes * doc/vmintegration.texinfo: Updated to match new threading bean API. * gnu/java/lang/management/ThreadMXBeanImpl.java: (MONITOR_SUPPORT): New constant for object monitor lock support property. (SYNCHRONIZER_SUPPORT): New constant for ownable synchronizer lock support property. (dumpAllThreads(boolean,boolean)): Implemented. (findDeadlockedThreads()): Likewise. (getThreadInfo(long[],boolean,boolean)): Likewise. (isObjectMonitorUsageSupported()): Likewise. (isSynchronizerUsageSupported()): Likewise. * java/lang/management/ThreadInfo.java: (ThreadInfo(Thread,long,long,Object,Thread,long, long,boolean,boolean,StackTraceElement[], MonitorInfo[], LockInfo[])): New constructor. (ThreadInfo(long,String,Thread.State,long,long, String,long,String,long,long,boolean,boolean, StackTraceElement[],MonitorInfo[], LockInfo[])): Likewise. (from(CompositeData)): Updated to handle new attributes. (getLockedMonitors()): Implemented. (getLockedSynchronizers()): Likewise. (getLockInfo()): Likewise. (getLockName()): Handle blocking as documented in 1.6 (getLockOwnerId()): Likewise. (getLockOwnerName()): Likewise. (toString()): Likewise. (isThreadBlocked()): Thread blocked check based on documented 1.6 semantics. * java/lang/management/ThreadMXBean.java: (dumpAllThreads(boolean,boolean)): Implemented. (findDeadlockedThreads()): Likewise. (getThreadInfo(long[],boolean,boolean)): Likewise. (isObjectMonitorUsageSupported()): Likewise. (isSynchronizerUsageSupported()): Likewise. * vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java: (findDeadlockedThreads()): New native method. (getLockInfo(ThreadInfo)): Likewise. (getMonitorInfo(ThreadInfo)): Likewise. --- .../java/lang/management/VMThreadMXBeanImpl.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'vm') diff --git a/vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java b/vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java index c5bcb6310..1c061aa93 100644 --- a/vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java +++ b/vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java @@ -58,6 +58,16 @@ final class VMThreadMXBeanImpl */ private static int filled; + /** + * Returns the ids of cycles of deadlocked threads, occurring + * due to monitor ownership or ownable synchronizer ownership. + * This will only be called if ownable synchronizer monitoring + * is supported. + * + * @return the ids of the deadlocked threads. + */ + static native long[] findDeadlockedThreads(); + /** * Returns the ids of cycles of deadlocked threads, occurring * due to monitor ownership. @@ -137,6 +147,25 @@ final class VMThreadMXBeanImpl return daemonCount; } + /** + * Fill out the given {@link ThreadInfo} object + * with ownable synchronizer usage information. + * This is only called if ownable synchronizer + * usage monitoring is supported. + * + * @param info the {@link ThreadInfo} object to modify. + */ + static native void getLockInfo(ThreadInfo info); + + /** + * Fill out the given {@link ThreadInfo} object + * with monitor usage information. This is only + * called if monitor usage monitoring is supported. + * + * @param info the {@link ThreadInfo} object to modify. + */ + static native void getMonitorInfo(ThreadInfo info); + /** * Returns the current peak number of live threads. * -- cgit v1.2.1