Skip to content

Commit 587e540

Browse files
committed
8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> \(a java\.lang\.Class ...'
Reviewed-by: kevinw, sspitsyn
1 parent 082fdf4 commit 587e540

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,19 @@ public static void main(String args[]) {
4747
objectLock.start();
4848
primitiveLock.start();
4949

50+
// Wait until all threads have reached their blocked or timed wait state
51+
while ((classLock1.getState() != Thread.State.BLOCKED &&
52+
classLock1.getState() != Thread.State.TIMED_WAITING) ||
53+
(classLock2.getState() != Thread.State.BLOCKED &&
54+
classLock2.getState() != Thread.State.TIMED_WAITING) ||
55+
(objectLock.getState() != Thread.State.TIMED_WAITING) ||
56+
(primitiveLock.getState() != Thread.State.TIMED_WAITING)) {
57+
try {
58+
Thread.sleep(100);
59+
} catch (InterruptedException ex) {
60+
}
61+
}
62+
5063
LingeredApp.main(args);
5164
}
5265
}

0 commit comments

Comments
 (0)