On Tue, 25 Nov 2025 12:10:40 GMT, Doug Lea <[email protected]> wrote:

>> test/jdk/java/util/concurrent/BlockingQueue/MissedPoll.java line 46:
>> 
>>> 44:         try (var pool = Executors.newCachedThreadPool()) {
>>> 45:             var futures = new ArrayList<Future<Integer>>();
>>> 46:             var phaser = new Phaser(4);
>> 
>> @DougLea Would it make sense to do the following, and then only keep a 
>> single `phaser.arriveAndAwaitAdvance();` ? (and skip the explicit q.clear())
>> 
>> Suggestion:
>> 
>>             var phaser = new Phaser(4) {
>>                 @Override
>>                 protected boolean onAdvance(int phase, int 
>> registeredParties) {
>>                     q.clear();
>>                     return super.onAdvance(phase, registeredParties);
>>                 }
>>             };
>
> Sure. I was just trying to minimally adapt the submitter's bug report as 
> test, so left this as-is.

It was primarily to validate my own understanding of equivalence :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28479#discussion_r2559816428

Reply via email to