System.IO.StreamWriter.CheckAsyncTaskInProgress C# (CSharp) 메소드

CheckAsyncTaskInProgress() 개인적인 메소드

private CheckAsyncTaskInProgress ( ) : void
리턴 void
        private void CheckAsyncTaskInProgress()
        {
            // We are not locking the access to _asyncWriteTask because this is not meant to guarantee thread safety. 
            // We are simply trying to deter calling any Write APIs while an async Write from the same thread is in progress.

            Task t = _asyncWriteTask;

            if (t != null && !t.IsCompleted)
                throw new InvalidOperationException(SR.InvalidOperation_AsyncIOInProgress);
        }