On Mon, 15 Apr 2024 20:39:26 GMT, Tim Prinzing <tprinz...@openjdk.org> wrote:

>> test/jdk/jdk/jfr/event/io/TestAsynchronousFileChannelEvents.java line 64:
>> 
>>> 62: 
>>> 63:             data.flip();
>>> 64:             ch.write(data, 0);
>> 
>> This just initiates the write operation, it doesn't wait until it completes. 
>> It returns a Future so adding .get() will ensure that it waits and that 
>> there is potentially data to write back to the file system.
>
> I do realize the write doesn't wait.  I was under the impression that flush() 
> does wait until everything has been flushed to disk.  I went ahead and added 
> .get() as requested.

In this API, the read/write methods are asynchronous, the force method is 
synchronous.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18542#discussion_r1566784789

Reply via email to