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

                yJ.Do(yJ.xT.Result).DoJob(ref wr, yK);
            }
Beispiel #3
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(Handler.GetProc(ref wr, ref yK));
 }
Beispiel #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;
        }
Beispiel #5
0
 public void Ready()
 {
     Worker.RunOnThisThread(this.sr, this);
 }
Beispiel #6
0
 /// Internal implementation detail.
 internal override void DoJob(ref Worker wr, Cont <T> xK)
 {
     xK.DoCont(ref wr, this.value);
 }
Beispiel #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);
 }
Beispiel #8
0
 internal override void DoCont(ref Worker wr, Unit value)
 {
 }
Beispiel #9
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(this.Cont.GetProc(ref wr));
 }
Beispiel #10
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     StaticData.writeLine("Top level handler raised: " + e.ToString());
 }
Beispiel #11
0
 internal override void DoWork(ref Worker wr)
 {
 }
Beispiel #12
0
 internal override Proc GetProc(ref Worker wr)
 {
     throw new NotImplementedException(); // XXX Top level handler has no process.
 }
Beispiel #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);
Beispiel #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);
Beispiel #15
0
 public void Ready()
 {
     Worker.ContinueOnThisThread(this.sr, this);
 }
Beispiel #16
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     this.Cont.DoHandle(ref wr, e);
 }
Beispiel #17
0
 internal void Ready()
 {
     Worker.ContinueOnThisThread(sr, this);
 }
Beispiel #18
0
 internal override void DoWork(ref Worker wr)
 {
     this.Cont.DoCont(ref wr, this.Value);
 }
Beispiel #19
0
 internal override void DoJob(ref Worker wr, Cont <Proc> pK)
 {
     Cont.Do(pK, ref wr, pK.GetProc(ref wr));
 }
Beispiel #20
0
 internal override void DoCont(ref Worker wr, T value)
 {
     this.Cont.DoCont(ref wr, value);
 }
Beispiel #21
0
 internal override void DoJob(ref Worker wr, Cont <Scheduler> sK)
 {
     Cont.Do(sK, ref wr, wr.Scheduler);
 }
Beispiel #22
0
 internal override void Ready(IAsyncResult iar)
 {
     this.iar = iar;
     Worker.RunOnThisThread(sr, this);
 }
Beispiel #23
0
 internal override void DoWork(ref Worker wr)
 {
     xK.DoCont(ref wr, xT.Result);
 }
Beispiel #24
0
 internal override void DoWork(ref Worker wr)
 {
     xK.DoCont(ref wr, xJ.DoEnd(iar));
 }
Beispiel #25
0
 internal override Proc GetProc(ref Worker wr)
 {
     return(uK.GetProc(ref wr));
 }
Beispiel #26
0
 internal override void DoJob(ref Worker wr, Cont <X> xK)
 {
     DoBegin(StaticData.workAsyncCallback, new Callback(wr.Scheduler, this, xK));
 }
Beispiel #27
0
 internal void Ready()
 {
     Worker.RunOnThisThread(sr, this);
 }
Beispiel #28
0
 internal override void DoCont(ref Worker wr, Unit value)
 {
     this.DoWork(ref wr);
 }
Beispiel #29
0
 internal override void DoHandle(ref Worker wr, Exception e)
 {
     Handler.DoHandle(yK, ref wr, e);
 }
Beispiel #30
0
 /// Internal implementation detail.
 internal abstract void DoWork(ref Worker wr);