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 * @summary Verifies JVMTI works for agents loaded into running VM
27 * @requires vm.jvmti
28 * @requires vm.continuations
29 * @enablePreview
30 * @library /test/lib /test/hotspot/jtreg
31 * @build jdk.test.whitebox.WhiteBox
32 *
33 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
34 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -agentlib:ToggleNotifyJvmtiTest ToggleNotifyJvmtiTest
35 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Djdk.attach.allowAttachSelf=true ToggleNotifyJvmtiTest attach
36 */
37
38 import com.sun.tools.attach.VirtualMachine;
39 import java.util.concurrent.ThreadFactory;
40 import jdk.test.whitebox.WhiteBox;
41
42 // The TestTask mimics some thread activity, but it is important
43 // to have sleep() calls to provide yielding as some frequency of virtual
44 // thread mount state transitions is needed for this test scenario.
45 class TestTask implements Runnable {
46 private String name;
47 private volatile boolean threadReady = false;
48 private volatile boolean shouldFinish = false;
49
|
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 * @summary Verifies JVMTI works for agents loaded into running VM
27 * @requires vm.jvmti
28 * @requires vm.continuations
29 * @library /test/lib /test/hotspot/jtreg
30 * @build jdk.test.whitebox.WhiteBox
31 *
32 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
33 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -agentlib:ToggleNotifyJvmtiTest ToggleNotifyJvmtiTest
34 * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -Djdk.attach.allowAttachSelf=true ToggleNotifyJvmtiTest attach
35 */
36
37 import com.sun.tools.attach.VirtualMachine;
38 import java.util.concurrent.ThreadFactory;
39 import jdk.test.whitebox.WhiteBox;
40
41 // The TestTask mimics some thread activity, but it is important
42 // to have sleep() calls to provide yielding as some frequency of virtual
43 // thread mount state transitions is needed for this test scenario.
44 class TestTask implements Runnable {
45 private String name;
46 private volatile boolean threadReady = false;
47 private volatile boolean shouldFinish = false;
48
|