ANHAdmin.AsyncOperation.WaitUntilDone C# (CSharp) Method

WaitUntilDone() public method

Blocks until the operation has either run to completion, or has been successfully cancelled, or has failed with an internal exception.
public WaitUntilDone ( ) : bool
return bool
        public bool WaitUntilDone()
        {
            lock (this)
            {
                // Wait for either completion or cancellation.  As with
                // CancelAndWait, we don't sleep forever - to reduce the
                // chances of deadlock in obscure race conditions, we wake
                // up every second to check we didn't miss a Pulse.
                while (!IsDone)
                {
                    Monitor.Wait(this, 1000);
                }
            }
            return HasCompleted;
        }