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

Chen Liang liach at openjdk.org
Tue Nov 19 07:46:21 UTC 2024


On Mon, 18 Nov 2024 16:17:20 GMT, Alan Bateman <alanb 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?

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

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


More information about the nio-dev mailing list