7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 4530538
27 * @summary Basic unit test of ThreadMXBean.getAllThreadIds()
28 * @author Alexei Guibadoulline and Mandy Chung
29 *
30 * @key intermittent
31 * @modules java.management
32 * @run main/othervm AllThreadIds
33 */
34
35 import java.lang.management.*;
36 import java.time.Instant;
37 import java.util.concurrent.Phaser;
38 import java.util.function.Supplier;
39
40 public class AllThreadIds {
41 /**
42 * A supplier wrapper for the delayed format printing.
43 * The supplied value will have to be formatted as <em>$s</em>
44 * @param <T> The wrapped type
45 */
46 private static final class ArgWrapper<T> {
47 private final Supplier<T> val;
48
49 public ArgWrapper(Supplier<T> val) {
50 this.val = val;
51 }
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 4530538
27 * @key intermittent
28 * @summary Basic unit test of ThreadMXBean.getAllThreadIds()
29 * @author Alexei Guibadoulline and Mandy Chung
30 *
31 * @run main/othervm AllThreadIds
32 */
33
34 import java.lang.management.*;
35 import java.time.Instant;
36 import java.util.concurrent.Phaser;
37 import java.util.function.Supplier;
38
39 public class AllThreadIds {
40 /**
41 * A supplier wrapper for the delayed format printing.
42 * The supplied value will have to be formatted as <em>$s</em>
43 * @param <T> The wrapped type
44 */
45 private static final class ArgWrapper<T> {
46 private final Supplier<T> val;
47
48 public ArgWrapper(Supplier<T> val) {
49 this.val = val;
50 }
|