示例#1
0
            void OnCompleted()
            {
                var p = this.parent;
                var a = this.awaiter;

                this.parent  = null;
                this.awaiter = default;

                pool.TryPush(this);

                try
                {
                    a.GetResult();
                }
                catch (Exception ex)
                {
                    p.exception = ExceptionDispatchInfo.Capture(ex);
                    p.TryInvokeContinuation();
                    return;
                }

                p.IncrementSuccessfully();
            }
示例#2
0
            public static void RegisterUnsafeOnCompleted(AsyncHandlerWhenAll <T> parent, Cysharp.Threading.Tasks.UniTask.Awaiter awaiter)
            {
                if (!pool.TryPop(out var result))
                {
                    result = new AwaiterNode();
                }
                result.parent  = parent;
                result.awaiter = awaiter;

                result.awaiter.UnsafeOnCompleted(result.continuation);
            }