Submit on hehalf of miao zheng.
In attached test Parker.java, two threads are created, second thread is created after first thread join and finish.
In jdk18, the second thread is parked. In jdk8 and jdk11, the second thread is not parked, it will just go ahead and print the log "^^^^^^: testPark12 running here".
Behavior should be same for jdk8/11 and lasted jdk18.
The problem is in jdk8/11 Parker::Allocate and Parker::Release. There is a free list of parker, and when the first thread exit, it releases the parker to the free list. Before the parker release to the free list, the _counter of Parker should be reset.
In jdk18, https://bugs.openjdk.java.net/browse/JDK-8223056 removes the free list of parker, and each thread has its own parker, so this problem is solved.
Not sure backport entier https://bugs.openjdk.java.net/browse/JDK-8223056. Or keep parker freelist mechanism, only reset _counter when release.