The "blocked in write" tests in BlockingSocketOps and BlockingChannelOps are 
problematic as the underlying non-blocking socket may be polled as writable 
several times before the virtual thread writer blocks indefinitely. The tests 
were updated recently to additional test the blocked thread's parkBlocker, 
which makes it harder to test when it wakes up several times.

The tests are simplified to avoid special casing the writing case. The 
runAfterParkedAsync method in both tests now polls the thread until it parks 
and the parkBlocker is set. BlockingChannelOps tests the expected parkBlocker 
whereas BlockingSocketOps just observed a non-null parkBlocker.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - Remove special casing for write
 - Merge branch 'master' into JDK-8397221
 - Merge branch 'master' into JDK-8397221
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/33907/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33907&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8397221
  Stats: 189 lines in 2 files changed: 23 ins; 121 del; 45 mod
  Patch: https://git.openjdk.org/jdk/pull/33907.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33907/head:pull/33907

PR: https://git.openjdk.org/jdk/pull/33907

Reply via email to