14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24
25 /*
26 * @test
27 * @bug 5086470
28 * @key intermittent
29 * @summary Basic Test for the following methods:
30 * - ThreadMXBean.findDeadlockedThreads()
31 * - ThreadMXBean.findMonitorDeadlockedThreads()
32 * @author Mandy Chung
33 *
34 * @modules java.management
35 * @build MonitorDeadlock
36 * @build SynchronizerDeadlock
37 * @build ThreadDump
38 * @run main/othervm FindDeadlocks
39 */
40
41 import java.lang.management.*;
42 import java.util.*;
43
44 public class FindDeadlocks {
45 static ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
46 public static void main(String[] argv) {
47 ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
48 // create deadlocked threads
49 MonitorDeadlock md = new MonitorDeadlock();
50
51 // no deadlock
52 if (findDeadlocks() != null) {
53 throw new RuntimeException("TEST FAILED: Should return null.");
54 }
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24
25 /*
26 * @test
27 * @bug 5086470
28 * @key intermittent
29 * @summary Basic Test for the following methods:
30 * - ThreadMXBean.findDeadlockedThreads()
31 * - ThreadMXBean.findMonitorDeadlockedThreads()
32 * @author Mandy Chung
33 *
34 * @build MonitorDeadlock
35 * @build SynchronizerDeadlock
36 * @build ThreadDump
37 * @run main/othervm FindDeadlocks
38 */
39
40 import java.lang.management.*;
41 import java.util.*;
42
43 public class FindDeadlocks {
44 static ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
45 public static void main(String[] argv) {
46 ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
47 // create deadlocked threads
48 MonitorDeadlock md = new MonitorDeadlock();
49
50 // no deadlock
51 if (findDeadlocks() != null) {
52 throw new RuntimeException("TEST FAILED: Should return null.");
53 }
|