Skip to content

Commit 6a9a5ef

Browse files
committed
8308043: Deadlock in TestCSLocker.java due to blocking GC while allocating
Backport-of: 285c833ffacdaabe7c4955cbbafb3bc459d26784
1 parent be33d68 commit 6a9a5ef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/hotspot/jtreg/gc/cslocker/TestCSLocker.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ public static void main(String args[]) throws Exception {
4848
// start CS locker thread
4949
CSLocker csLocker = new CSLocker();
5050
csLocker.start();
51+
// After the CSLocker thread has started, any operation such as an allocation,
52+
// which could rely on the GC to make progress, will cause a deadlock that will
53+
// make the test time out. That includes printing. Please don't use any such
54+
// code until unlock() is called below.
5155

5256
// check timeout to success deadlocking
53-
while(System.currentTimeMillis() < startTime + timeout) {
54-
System.out.println("sleeping...");
57+
while (System.currentTimeMillis() < startTime + timeout) {
5558
sleep(1000);
5659
}
5760

0 commit comments

Comments
 (0)