Move `runWith()` from `VirtualThread` to `BaseVirtualThread`. `BoundVirtualThread` does not use `runWith()` to run its task, so when a VM error occurs it can not recover scoped values.
Moving `runWith()` into the common subclass of both `VirtualThread` and `BoundVirtualThread` fixes the problem. ------------- Commit messages: - Move runWith() from VirtualThread to BaseVirtualThread. Changes: https://git.openjdk.org/jdk/pull/14399/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14399&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8308609 Stats: 25 lines in 4 files changed: 14 ins; 9 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/14399.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14399/head:pull/14399 PR: https://git.openjdk.org/jdk/pull/14399