mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
17 lines
290 B
Java
17 lines
290 B
Java
import java.util.stream.Stream;
|
|
|
|
class Test {
|
|
public static void main(String[] args) {
|
|
long thread = Thread.currentThread().getId();
|
|
|
|
Stream.of(1, 2, 3, 4)
|
|
.parallel()
|
|
.forEach(e -> {
|
|
if (Thread.currentThread().getId() == thread) {
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|