On Wed, 5 Mar 2025 15:13:06 GMT, Viktor Klang <vkl...@openjdk.org> wrote:

>> Doug Lea has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Reduce volatile reads
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3741:
> 
>> 3739:     public <V> ForkJoinTask<V> submitWithTimeout(Callable<V> callable,
>> 3740:                                                  long timeout, 
>> TimeUnit unit,
>> 3741:                                                  
>> Consumer<ForkJoinTask<V>> timeoutAction) {
> 
> I wonder if the variance of the Consumer to this method should be more 
> permissible. Something like:
> 
> public <V> ForkJoinTask<V> submitWithTimeout(Callable<V> callable,
>                                                  long timeout, TimeUnit unit,
>                                                  Consumer<? super 
> ForkJoinTask<? extends V>> timeoutAction) {

Maybe it's worth using java.time.Duration, although it doesn't fit into the API 
very elegantly.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1982349285

Reply via email to