MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / close

Method close

Libraries/Async/Async.cpp:729–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729SC::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
748SC::Result SC::AsyncFileSystemOperation::read(AsyncEventLoop& eventLoop, FileDescriptor::Handle handle,
749 Span<char> buffer, uint64_t offset)

Callers

nothing calls this directly

Calls 13

PlacementNewClass · 0.85
popMethod · 0.80
ResultClass · 0.70
ErrorEnum · 0.50
startMethod · 0.45
exchangeMethod · 0.45
signalMethod · 0.45
joinMethod · 0.45
stopMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected