/// <summary>
        /// Resumes the task.
        /// </summary>
        public void Resume(bool drain = false)
        {
            ThrowIfDisposed();

            if (!_pausing)
            {
                throw new InvalidOperationException("Not paused");
            }

            if (drain)
            {
                _addresses.Drain();
            }

            _resume.Release();
        }