jdk/test/demo/jvmti/Context.java
author amurillo
Fri, 17 Jul 2015 08:46:54 -0700
changeset 31814 b8431927ad72
parent 22274 10fc71a1d166
parent 31813 977744526c8d
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31813
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     1
/*
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     2
 * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     4
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     7
 * published by the Free Software Foundation.
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     8
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    13
 * accompanied this code).
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    14
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    18
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    21
 * questions.
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    22
 */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    23
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    24
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    25
/*
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    26
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    27
 *   Sample target application for jvmti demos
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    28
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    29
 *     java Context [threadCount [iterationCount [sleepContention]]]
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    30
 *           Default: java Context 5 10 0
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    31
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    32
 *      threadCount     Number of threads
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    33
 *      iterationCount  Total turns taken for all threads
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    34
 *      sleepContention Time for main thread to sleep while holding lock
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    35
 *                      (creates monitor contention on all other threads)
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    36
 *
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    37
 */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    38
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    39
/* Used to sync up turns and keep track of who's turn it is */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    40
final class TurnChecker {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    41
    int thread_index;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    42
    TurnChecker(int thread_index) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    43
        this.thread_index = thread_index;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    44
    }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    45
}
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    46
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    47
/* Creates a bunch of threads that sequentially take turns */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    48
public final class Context extends Thread {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    49
    /* Used to track threads */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    50
    private static long startTime;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    51
    private static TurnChecker turn = new TurnChecker(-1);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    52
    private static int total_turns_taken;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    53
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    54
    /* Used for each Context thread */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    55
    private final int thread_count;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    56
    private final int thread_index;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    57
    private final int thread_turns;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    58
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    59
    /* Main program */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    60
    public static void main(String[] argv) throws InterruptedException {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    61
        int default_thread_count = 5;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    62
        int default_thread_turns = 10;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    63
        int default_contention_sleep = 0;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    64
        int expected_turns_taken;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    65
        long sleepTime = 10L;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    66
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    67
        /* Override defaults */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    68
        if ( argv.length >= 1 ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    69
            default_thread_count = Integer.parseInt(argv[0]);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    70
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    71
        if ( argv.length >= 2 ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    72
            expected_turns_taken = Integer.parseInt(argv[1]);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    73
            default_thread_turns = expected_turns_taken/default_thread_count;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    74
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    75
        expected_turns_taken = default_thread_count*default_thread_turns;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    76
        if ( argv.length >= 3 ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    77
            default_contention_sleep = Integer.parseInt(argv[2]);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    78
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    79
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    80
        System.out.println("Context started with "
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    81
                 + default_thread_count + " threads and "
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    82
                 + default_thread_turns + " turns per thread");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    83
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    84
        /* Get all threads running (they will block until we set turn) */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    85
        for (int i = 0; i < default_thread_count; i++) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    86
            new Context(default_thread_count, i, default_thread_turns).start();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    87
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    88
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    89
        /* Sleep to make sure thread_index 0 make it to the wait call */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    90
        System.out.println("Context sleeping, so threads will start wait");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    91
        Thread.yield();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    92
        Thread.sleep(sleepTime);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    93
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    94
        /* Save start time */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    95
        startTime = System.currentTimeMillis();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    96
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    97
        /* This triggers the starting of taking turns */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    98
        synchronized (turn) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
    99
            turn.thread_index = 0;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   100
            turn.notifyAll();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   101
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   102
        System.out.println("Context sleeping, so threads can run");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   103
        Thread.yield();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   104
        Thread.sleep(sleepTime);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   105
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   106
        /* Wait for threads to finish (after everyone has had their turns) */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   107
        while ( true ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   108
            boolean done;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   109
            done = false;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   110
            synchronized (turn) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   111
                if ( total_turns_taken == expected_turns_taken ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   112
                    done = true;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   113
                }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   114
                /* Create some monitor contention by sleeping with lock */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   115
                if ( default_contention_sleep > 0 ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   116
                    System.out.println("Context sleeping, to create contention");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   117
                    Thread.yield();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   118
                    Thread.sleep((long)default_contention_sleep);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   119
                }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   120
            }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   121
            if ( done )
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   122
                break;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   123
            System.out.println("Context sleeping, so threads will complete");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   124
            Thread.sleep(sleepTime);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   125
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   126
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   127
        long endTime   = System.currentTimeMillis();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   128
        long totalTime = endTime - startTime;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   129
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   130
        System.out.println("Total time (milliseconds): " + totalTime);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   131
        System.out.println("Milliseconds per thread: " +
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   132
                           ((double)totalTime / (default_thread_count)));
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   133
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   134
        System.out.println("Context completed");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   135
        System.exit(0);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   136
    }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   137
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   138
    /* Thread object to run */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   139
    Context(int thread_count, int thread_index, int thread_turns) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   140
        this.thread_count = thread_count;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   141
        this.thread_index = thread_index;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   142
        this.thread_turns = thread_turns;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   143
    }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   144
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   145
    /* Main for thread */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   146
    public void run() {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   147
        int next_thread_index = (thread_index + 1) % thread_count;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   148
        int turns_taken       = 0;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   149
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   150
        try {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   151
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   152
            /* Loop until we make sure we get all our turns */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   153
            for (int i = 0; i < thread_turns * thread_count; i++) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   154
                synchronized (turn) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   155
                    /* Keep waiting for our turn */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   156
                    while (turn.thread_index != thread_index)
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   157
                        turn.wait();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   158
                    /* MY TURN! Each thread gets thread_turns */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   159
                    total_turns_taken++;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   160
                    turns_taken++;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   161
                    System.out.println("Turn #" + total_turns_taken
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   162
                                + " taken by thread " + thread_index
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   163
                                + ", " + turns_taken
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   164
                                + " turns taken by this thread");
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   165
                    /* Give next thread a turn */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   166
                    turn.thread_index = next_thread_index;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   167
                    turn.notifyAll();
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   168
                }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   169
                /* If we've had all our turns, break out of this loop */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   170
                if (thread_turns == turns_taken) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   171
                    System.out.println("Loop end: thread got " + turns_taken
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   172
                            + " turns, expected " + thread_turns);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   173
                    break;
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   174
                }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   175
            }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   176
        } catch (InterruptedException intEx) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   177
            System.out.println("Got an InterruptedException:" + intEx);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   178
            /* skip */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   179
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   180
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   181
        /* Make sure we got all our turns */
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   182
        if ( thread_turns != turns_taken ) {
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   183
            System.out.println("ERROR: thread got " + turns_taken
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   184
                                        + " turns, expected " + thread_turns);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   185
            System.exit(1);
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   186
        }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   187
    }
977744526c8d 8131328: Restore demo/jvmti tests
ykantser
parents:
diff changeset
   188
}