Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows a 'file.close.wait' to return a true close return value. And it fixes the problem of indefinitely hanging when the SharedFd was still held by an in-flight operation.
It simplifies the low level close logic, using the async uring close operation when the caller is using file.close.wait but using the synchronous close mechanism provided by the std library when the SharedFd is allowed to go out of scope without having been closed first.
Manual closing of the file should be encouraged because it allows the user to see the return code.
In order to let the file owner call close and not hang when an in-flight was still in progress, this reworks the future to return when it sees the strong reference count drop to 1.
Fixes