mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8311867: StructuredTaskScope.shutdown does not interrupt newly started threads
Reviewed-by: jpai
This commit is contained in:
parent
f60c1f9bc4
commit
92a04e201e
3 changed files with 99 additions and 4 deletions
|
@ -59,7 +59,7 @@ import jdk.internal.misc.ThreadFlock;
|
|||
* used to get the result completed successfully, or the exception if the subtask failed.
|
||||
* {@snippet lang=java :
|
||||
* Callable<String> task1 = ...
|
||||
* Callable<Integer> task1 = ...
|
||||
* Callable<Integer> task2 = ...
|
||||
*
|
||||
* try (var scope = new StructuredTaskScope<Object>()) {
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -451,7 +451,7 @@ public class ThreadFlock implements AutoCloseable {
|
|||
}
|
||||
|
||||
/**
|
||||
* {@return a stream of the live threads in this flock}
|
||||
* {@return a stream of the threads in this flock}
|
||||
* The elements of the stream are threads that were started in this flock
|
||||
* but have not terminated. The stream will reflect the set of threads in the
|
||||
* flock at some point at or since the creation of the stream. It may or may
|
||||
|
@ -459,7 +459,7 @@ public class ThreadFlock implements AutoCloseable {
|
|||
* stream.
|
||||
*/
|
||||
public Stream<Thread> threads() {
|
||||
return threads.stream().filter(Thread::isAlive);
|
||||
return threads.stream();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue