Commit dceef6e
committed
Silently fall back to platform threads when virtual=true on Java 17
Per Concurrency 3.1 spec: "When running on Java SE 17, the true value
behaves the same as the false value and results in platform threads
being created rather than virtual threads."
Previously, virtual=true unconditionally called VirtualThreadHelper
methods which throw UnsupportedOperationException on Java 17. Now
checks VirtualThreadHelper.isSupported() first and falls through to
platform thread creation when virtual threads are unavailable.1 parent b6a2535 commit dceef6e
3 files changed
Lines changed: 9 additions & 4 deletions
File tree
- container/openejb-core/src/main/java/org/apache/openejb
- cdi/concurrency
- resource/thread
- threads/impl
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
container/openejb-core/src/main/java/org/apache/openejb/threads/impl/ManagedThreadFactoryImpl.java
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
0 commit comments