mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8336254: Virtual thread implementation + test updates
Reviewed-by: sspitsyn, kevinw
This commit is contained in:
parent
d3e51daf73
commit
6e228ce382
39 changed files with 2741 additions and 1363 deletions
|
@ -65,7 +65,6 @@ import java.util.PropertyPermission;
|
|||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -2264,6 +2263,7 @@ public final class System {
|
|||
super(fd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
boolean attempted = Blocker.begin();
|
||||
try {
|
||||
|
@ -2677,14 +2677,6 @@ public final class System {
|
|||
return Thread.currentCarrierThread();
|
||||
}
|
||||
|
||||
public <V> V executeOnCarrierThread(Callable<V> task) throws Exception {
|
||||
if (Thread.currentThread() instanceof VirtualThread vthread) {
|
||||
return vthread.executeOnCarrierThread(task);
|
||||
} else {
|
||||
return task.call();
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local) {
|
||||
return ((ThreadLocal<T>)local).getCarrierThreadLocal();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue