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 4530538
27 * @summary Basic unit test of the synchronization statistics support:
28 *
29 * @author Mandy Chung
30 * @author Jaroslav Bachorik
31 *
32 * @run main/othervm SynchronizationStatistics
33 */
34
35 import java.lang.management.*;
36 import java.util.concurrent.Phaser;
37 import java.util.function.Supplier;
38
39 public class SynchronizationStatistics {
40 private static class LockerThread extends Thread {
41 public LockerThread(Runnable r) {
42 super(r, "LockerThread");
43 }
44 }
45
46 private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
47
48 private static final boolean blockedTimeCheck =
49 mbean.isThreadContentionMonitoringSupported();
50
51
|
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 4530538
27 * @summary Basic unit test of the synchronization statistics support:
28 *
29 * @author Mandy Chung
30 * @author Jaroslav Bachorik
31 *
32 * @modules java.management
33 * @run main/othervm SynchronizationStatistics
34 */
35
36 import java.lang.management.*;
37 import java.util.concurrent.Phaser;
38 import java.util.function.Supplier;
39
40 public class SynchronizationStatistics {
41 private static class LockerThread extends Thread {
42 public LockerThread(Runnable r) {
43 super(r, "LockerThread");
44 }
45 }
46
47 private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
48
49 private static final boolean blockedTimeCheck =
50 mbean.isThreadContentionMonitoringSupported();
51
52
|