Test only change to fix a race in testThreadContainer where SynchronousQueue::put consumes the parking permit that the main thread makes available. The test is changed to use a CompletableFuture so that the main thread waits. testStructuredTaskScopeJoin is updated to do the same. This test doesn't have an issue but it keeps the hand offs in the two tests the same. In passing, improved the robustness of testWaitingThread.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/34179/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=34179&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8398672 Stats: 25 lines in 1 file changed: 6 ins; 7 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/34179.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/34179/head:pull/34179 PR: https://git.openjdk.org/jdk/pull/34179
