示例#1
0
        internal override void DoWork(ref Worker wr)
        {
            var pk  = this.pk;
            var cts = this.cts;

            if (null == cts)
            {
                goto Done;
            }
            this.cts = null;
            var picked = Pick.PickAndSetNacks(pk, ref wr, this.me);

            if (0 != picked)
            {
                cts.Cancel();
            }
            cts.Dispose();
            if (0 != picked)
            {
                goto Done;
            }
            xK.DoCont(ref wr, xT.Result);
Done:
            return;
        }
示例#2
0
        internal override void DoWork(ref Worker wr)
        {
            var pk  = this.pk;
            var cts = this.cts;

            if (null == cts)
            {
                goto Done;
            }
            this.cts = null;
            var picked = Pick.PickAndSetNacks(pk, ref wr, this.me);

            if (0 != picked)
            {
                cts.Cancel();
            }
            cts.Dispose();
            if (0 != picked)
            {
                goto Done;
            }
            var xT = this.xT;

            if (TaskStatus.Faulted == xT.Status)
            {
                xK.DoHandle(ref wr, xT.Exception);
            }
            else
            {
                xK.DoCont(ref wr, xT.Result);
            }
Done:
            return;
        }
示例#3
0
        internal override void DoWork(ref Worker wr)
        {
            var me = this.me;

            if (me < 0 && me == Interlocked.CompareExchange(ref this.me, 0, me))
            {
                return;
            }
            if (0 != Pick.PickAndSetNacks(pk, ref wr, me))
            {
                xJ.DoCancel(iar);
            }
            else
            {
                Cont.Do(xK, ref wr, xJ.DoEnd(iar));
            }
        }