Skip to content

Commit

Permalink
8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\…
Browse files Browse the repository at this point in the history
…s+- waiting to lock <0x[0-9a-f]+> \(a java\.lang\.Class ...'

Backport-of: 587e5409c2488cf8c3579a4932c588efc5a02749
  • Loading branch information
GoeLin committed Sep 22, 2022
1 parent c59f741 commit 2bdea0f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -47,6 +47,19 @@ public static void main(String args[]) {
objectLock.start();
primitiveLock.start();

// Wait until all threads have reached their blocked or timed wait state
while ((classLock1.getState() != Thread.State.BLOCKED &&
classLock1.getState() != Thread.State.TIMED_WAITING) ||
(classLock2.getState() != Thread.State.BLOCKED &&
classLock2.getState() != Thread.State.TIMED_WAITING) ||
(objectLock.getState() != Thread.State.TIMED_WAITING) ||
(primitiveLock.getState() != Thread.State.TIMED_WAITING)) {
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
}
}

LingeredApp.main(args);
}
}

0 comments on commit 2bdea0f

Please sign in to comment.