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 7194254
27 * @summary Creates several threads with different java priorities and checks
28 * whether jstack reports correct priorities for them.
29 *
30 * @library /testlibrary
31 * @run main ThreadPriorities
32 */
33
34 import java.util.ArrayList;
35 import java.util.concurrent.CyclicBarrier;
36 import java.util.regex.Matcher;
37 import java.util.regex.Pattern;
38
39 import com.oracle.java.testlibrary.*;
40 import static com.oracle.java.testlibrary.Asserts.*;
41
42 public class ThreadPriorities {
43
44 public static void main(String[] args) throws Throwable {
45 final int NUMBER_OF_JAVA_PRIORITIES =
46 Thread.MAX_PRIORITY - Thread.MIN_PRIORITY + 1;
47 final CyclicBarrier barrier =
48 new CyclicBarrier(NUMBER_OF_JAVA_PRIORITIES + 1);
49
50 for (int p = Thread.MIN_PRIORITY; p <= Thread.MAX_PRIORITY; ++p) {
|
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 7194254
27 * @summary Creates several threads with different java priorities and checks
28 * whether jstack reports correct priorities for them.
29 *
30 * @library /testlibrary
31 * @build com.oracle.java.testlibrary.*
32 * @run main ThreadPriorities
33 */
34
35 import java.util.ArrayList;
36 import java.util.concurrent.CyclicBarrier;
37 import java.util.regex.Matcher;
38 import java.util.regex.Pattern;
39
40 import com.oracle.java.testlibrary.*;
41 import static com.oracle.java.testlibrary.Asserts.*;
42
43 public class ThreadPriorities {
44
45 public static void main(String[] args) throws Throwable {
46 final int NUMBER_OF_JAVA_PRIORITIES =
47 Thread.MAX_PRIORITY - Thread.MIN_PRIORITY + 1;
48 final CyclicBarrier barrier =
49 new CyclicBarrier(NUMBER_OF_JAVA_PRIORITIES + 1);
50
51 for (int p = Thread.MIN_PRIORITY; p <= Thread.MAX_PRIORITY; ++p) {
|