Fix the special ThreadPool's LinkedTransferQueue of MatsFuturizer to handle Java 21.0.2's reimpl of put(E) method!
stolsvik opened this issue · 0 comments
stolsvik commented
Previously, LinkedTransferQueue's methods offer(E)
and put(E)
had separate implementations, but with the same code:
xfer(e, true, ASYNC, 0L);
Thus, when we overrode offer(E)
to invoke tryTranser(e)
, the put(E)
method was unaffected. And the special implementation of MatsFuturizer's ThreadPoolExecutor's RejectedExecutionHandler used the put(E)
method to enqueue the task "anyway".
However, with Java 21.0.2, the put(E)
method was reimplemented to just call offer(E)
! This was pretty bad news for the MatsFuturizer implementation: If more than maximumPoolSize
tasks were enqueued, the latter ones would just be thrown out.
Fix this to make a new sneak(E)
method that invokes super.offer(E)
instead.