11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
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 * @test
26 * @bug 5086470 6358247
27 * @summary Basic Test for ThreadMXBean.dumpAllThreads(false, true)
28 * and getThreadInfo of customized JSR-166 synchronizers.
29 * @author Mandy Chung
30 *
31 * @modules java.management
32 * @build Barrier
33 * @build ThreadDump
34 * @run main/othervm MyOwnSynchronizer
35 */
36
37 import java.lang.management.*;
38 import java.util.*;
39 import java.util.concurrent.locks.*;
40 import java.util.concurrent.TimeUnit;
41 import java.io.*;
42
43 public class MyOwnSynchronizer {
44 static ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
45 static Mutex mutex = new Mutex();
46 static MyThread thread = new MyThread();
47 public static void main(String[] argv) throws Exception {
48 if (!mbean.isSynchronizerUsageSupported()) {
49 System.out.println("Monitoring of synchronizer usage not supported");
50 return;
51 }
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
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 * @test
26 * @bug 5086470 6358247
27 * @summary Basic Test for ThreadMXBean.dumpAllThreads(false, true)
28 * and getThreadInfo of customized JSR-166 synchronizers.
29 * @author Mandy Chung
30 *
31 * @build Barrier
32 * @build ThreadDump
33 * @run main/othervm MyOwnSynchronizer
34 */
35
36 import java.lang.management.*;
37 import java.util.*;
38 import java.util.concurrent.locks.*;
39 import java.util.concurrent.TimeUnit;
40 import java.io.*;
41
42 public class MyOwnSynchronizer {
43 static ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
44 static Mutex mutex = new Mutex();
45 static MyThread thread = new MyThread();
46 public static void main(String[] argv) throws Exception {
47 if (!mbean.isSynchronizerUsageSupported()) {
48 System.out.println("Monitoring of synchronizer usage not supported");
49 return;
50 }
|