public async Task StopAsync() { PrepareToStop(); // Wait until reader is done if (m_injectionRequestReader != null) { await m_injectionRequestReader.CompletionAsync(true); } }
private async Task WaitUntilReportEof(bool cancel) { using (await m_reportReaderSemaphore.AcquireAsync()) { if (m_reportReader != null) { await m_reportReader.CompletionAsync(!cancel); m_reportReader.Dispose(); m_reportReader = null; } } }