RFR: 8344328: (dc) DatagramChannelImpl.blockingReceive can now synchronize on packet

Alan Bateman alanb at openjdk.org
Tue Nov 19 07:46:21 UTC 2024


On Mon, 18 Nov 2024 22:10:40 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Now that JEP 491 is integrated, we can restore long-standing behavior in the DatagramSocket adaptor to synchronize on the DatagramPacket for the duration of the send/receive.
>
> src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java line 865:
> 
>> 863:                     }
>> 864: 
>> 865:                     // send the datagram (does not block)
> 
> Now this send is in the synchronized block; should this "does not block" be moved to the top level synchronized block?

The comment is for the call to send, so it's in the right place.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22212#discussion_r1847761632


More information about the nio-dev mailing list