Commit f1ddff4
committed
Stabilize TestSharedCloseJvmti by avoiding latch park
Update TestSharedCloseJvmti to remove CountDownLatch.await() from the
JVMTI re-entrant callback path and replace it with a spin wait on a
volatile flag.
The previous test parked the Trigger thread while executing re-entrantly
from a JVMTI MethodExit callback during a scoped access. On OpenJ9,
shared scope close relies on async polling (javaCheckAsyncMessages) for
close-scope acknowledgement. Parking the thread in this path can prevent
polling and cause intermittent hangs.
The test intent is to exercise additional stack frames during scoped
access, not thread parking inside JVMTI callbacks. Using a spin loop
keeps the thread runnable and preserves the stack-shape stress scenario
while avoiding the hang.
Scoped close/exception handling differs across JVMs. The RI uses a
per-thread handshake and deopt-based approach, while OpenJ9 uses a
flag-and-polling model. This change keeps the test portable across both.
Remove the unused TARGET_LATCH and add a volatile CLOSED flag for
cross-thread visibility.
Related: eclipse-openj9/openj9#22934
Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>1 parent e1f4c54 commit f1ddff4
File tree
1 file changed
+10
-7
lines changed1 file changed
+10
-7
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | | - | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| |||
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
0 commit comments