| 727 | } |
| 728 | |
| 729 | SC::Result SC::AsyncFileSystemOperation::close(AsyncEventLoop& eventLoop, FileDescriptor::Handle handle) |
| 730 | { |
| 731 | SC_TRY(checkState()); |
| 732 | operation = Operation::Close; |
| 733 | new (&closeData, PlacementNew()) CloseData({handle}); |
| 734 | if (not eventLoop.needsThreadPoolForFileOperations() and threadPoolMode != AsyncThreadPoolMode::ForceThreadPool) |
| 735 | { |
| 736 | return eventLoop.start(*this); |
| 737 | } |
| 738 | |
| 739 | loopWork.work = [&]() |
| 740 | { |
| 741 | FileDescriptor fd(closeData.handle); |
| 742 | return fd.close(); |
| 743 | }; |
| 744 | loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this); |
| 745 | return eventLoop.start(loopWork); |
| 746 | } |
| 747 | |
| 748 | SC::Result SC::AsyncFileSystemOperation::read(AsyncEventLoop& eventLoop, FileDescriptor::Handle handle, |
| 749 | Span<char> buffer, uint64_t offset) |
nothing calls this directly
no test coverage detected