Esempio n. 1
0
        private PipeCompletionCallbacks GetCallbacks()
        {
            Debug.Assert(IsCompleted);
            if (_callbackCount == 0)
            {
                return(null);
            }

            var callbacks = new PipeCompletionCallbacks(s_completionCallbackPool,
                                                        _callbackCount,
                                                        _exception == s_completedNoException ? null : _exception,
                                                        _callbacks);

            _callbacks     = null;
            _callbackCount = 0;
            return(callbacks);
        }
Esempio n. 2
0
        private PipeCompletionCallbacks GetCallbacks()
        {
            Debug.Assert(IsCompleted);
            if (_callbackCount == 0)
            {
                return(null);
            }

            var callbacks = new PipeCompletionCallbacks(s_completionCallbackPool,
                                                        _callbackCount,
                                                        _exceptionInfo?.SourceException,
                                                        _firstCallback,
                                                        _callbacks);

            _firstCallback = default;
            _callbacks     = null;
            _callbackCount = 0;
            return(callbacks);
        }