Exemple #1
0
 internal override void DoWork(ref Worker wr)
 {
     this.hr.DoHandle(ref wr, this.e);
 }
Exemple #2
0
            internal override void DoWork(ref Worker wr)
            {
                var yJ = this.yJ;

                yJ.Do(yJ.xT.Result).DoJob(ref wr, yK);
            }
Exemple #3
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(Handler.GetProc(ref wr, ref yK));
 }
Exemple #4
0
        internal static void Signal(ref Worker wr, Nack nk)
        {
Spin:
            var state = nk.State;

            if (state > Initial)
            {
                goto JustExit;            // XXX Can this happen?
            }
            if (state < Initial)
            {
                goto Spin;
            }
            if (Initial != Interlocked.CompareExchange(ref nk.State, Signaled, Initial))
            {
                goto Spin;
            }

            var takers = nk.Takers;

            if (null == takers)
            {
                goto JustExit;
            }
            nk.Takers = null;
            var  me     = 0;
            Work cursor = takers;

TryTaker:
            var taker = cursor as Cont <Unit>;

            cursor = cursor.Next;
            var pk = taker.GetPick(ref me);

            if (null == pk)
            {
                goto GotTaker;
            }

TryPick:
            var st = Pick.TryPick(pk);

            if (st > 0)
            {
                goto TryNextTaker;
            }
            if (st < 0)
            {
                goto TryPick;
            }

            Pick.SetNacks(ref wr, me, pk);
GotTaker:
            taker.Next = null;
            Worker.Push(ref wr, taker);
TryNextTaker:
            if (cursor != takers)
            {
                goto TryTaker;
            }
JustExit:
            return;
        }
Exemple #5
0
 public void Ready()
 {
     Worker.RunOnThisThread(this.sr, this);
 }
Exemple #6
0
 /// Internal implementation detail.
 internal override void DoJob(ref Worker wr, Cont <T> xK)
 {
     xK.DoCont(ref wr, this.value);
 }
Exemple #7
0
 internal override void DoJob(ref Worker wr, Cont <Unit> uK)
 {
     // See Worker.RunOnThisThread to understand why this works.
     Worker.Push(ref wr, uK);
 }
Exemple #8
0
 internal override void DoCont(ref Worker wr, Unit value)
 {
 }
Exemple #9
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(this.Cont.GetProc(ref wr));
 }
Exemple #10
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     StaticData.writeLine("Top level handler raised: " + e.ToString());
 }
Exemple #11
0
 internal override void DoWork(ref Worker wr)
 {
 }
Exemple #12
0
 internal override Proc GetProc(ref Worker wr)
 {
     throw new NotImplementedException(); // XXX Top level handler has no process.
 }
Exemple #13
0
 /// <summary>Do not call this directly unless you know that the handler is not null.</summary>
 internal abstract Proc GetProc(ref Worker wr);
Exemple #14
0
 /// <summary>Do not call this directly unless you know that the handler is not null.</summary>
 internal abstract void DoHandle(ref Worker wr, Exception e);
Exemple #15
0
 public void Ready()
 {
     Worker.ContinueOnThisThread(this.sr, this);
 }
Exemple #16
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     this.Cont.DoHandle(ref wr, e);
 }
Exemple #17
0
 internal void Ready()
 {
     Worker.ContinueOnThisThread(sr, this);
 }
Exemple #18
0
 internal override void DoWork(ref Worker wr)
 {
     this.Cont.DoCont(ref wr, this.Value);
 }
Exemple #19
0
 internal override void DoJob(ref Worker wr, Cont <Proc> pK)
 {
     Cont.Do(pK, ref wr, pK.GetProc(ref wr));
 }
Exemple #20
0
 internal override void DoCont(ref Worker wr, T value)
 {
     this.Cont.DoCont(ref wr, value);
 }
Exemple #21
0
 internal override void DoJob(ref Worker wr, Cont <Scheduler> sK)
 {
     Cont.Do(sK, ref wr, wr.Scheduler);
 }
Exemple #22
0
 internal override void Ready(IAsyncResult iar)
 {
     this.iar = iar;
     Worker.RunOnThisThread(sr, this);
 }
Exemple #23
0
 internal override void DoWork(ref Worker wr)
 {
     xK.DoCont(ref wr, xT.Result);
 }
Exemple #24
0
 internal override void DoWork(ref Worker wr)
 {
     xK.DoCont(ref wr, xJ.DoEnd(iar));
 }
Exemple #25
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(uK.GetProc(ref wr));
 }
Exemple #26
0
 internal override void DoJob(ref Worker wr, Cont <X> xK)
 {
     DoBegin(StaticData.workAsyncCallback, new Callback(wr.Scheduler, this, xK));
 }
Exemple #27
0
 internal void Ready()
 {
     Worker.RunOnThisThread(sr, this);
 }
Exemple #28
0
 internal override void DoCont(ref Worker wr, Unit value)
 {
     this.DoWork(ref wr);
 }
Exemple #29
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     Handler.DoHandle(yK, ref wr, e);
 }
Exemple #30
0
 /// Internal implementation detail.
 internal abstract void DoWork(ref Worker wr);