On Mon, 7 Apr 2025 11:55:08 GMT, kabutz <d...@openjdk.org> wrote:

> LinkedBlockingDeque.clear() should preserve weakly-consistent iterators by 
> linking f.prev and f.next back to f, allowing the iterators to continue from 
> the first or last respectively. This would be consistent with how the other 
> node-based weakly consistent queues LinkedBlockingQueue LinkedTransferQueue, 
> ConcurrentLinkedQueue/Deque work.
> 
> The LBD already supports self-linking, since that is done by the 
> unlinkFirst() and unlinkLast() methods, and the iterators and spliterator all 
> support this.
> 
> This can be fixed very easily by linking both f.prev and f.next back to f.

These changes have been included in https://github.com/openjdk/jdk/pull/24925

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

PR Comment: https://git.openjdk.org/jdk/pull/24488#issuecomment-2876408558

Reply via email to