internal override void DoWork(ref Worker wr) { this.hr.DoHandle(ref wr, this.e); }
internal override void DoWork(ref Worker wr) { var yJ = this.yJ; yJ.Do(yJ.xT.Result).DoJob(ref wr, yK); }
internal override Proc GetProc(ref Worker wr) { return(Handler.GetProc(ref wr, ref yK)); }
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; }
public void Ready() { Worker.RunOnThisThread(this.sr, this); }
/// Internal implementation detail. internal override void DoJob(ref Worker wr, Cont <T> xK) { xK.DoCont(ref wr, this.value); }
internal override void DoJob(ref Worker wr, Cont <Unit> uK) { // See Worker.RunOnThisThread to understand why this works. Worker.Push(ref wr, uK); }
internal override void DoCont(ref Worker wr, Unit value) { }
internal override Proc GetProc(ref Worker wr) { return(this.Cont.GetProc(ref wr)); }
internal override void DoHandle(ref Worker wr, Exception e) { StaticData.writeLine("Top level handler raised: " + e.ToString()); }
internal override void DoWork(ref Worker wr) { }
internal override Proc GetProc(ref Worker wr) { throw new NotImplementedException(); // XXX Top level handler has no process. }
/// <summary>Do not call this directly unless you know that the handler is not null.</summary> internal abstract Proc GetProc(ref Worker wr);
/// <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);
public void Ready() { Worker.ContinueOnThisThread(this.sr, this); }
internal override void DoHandle(ref Worker wr, Exception e) { this.Cont.DoHandle(ref wr, e); }
internal void Ready() { Worker.ContinueOnThisThread(sr, this); }
internal override void DoWork(ref Worker wr) { this.Cont.DoCont(ref wr, this.Value); }
internal override void DoJob(ref Worker wr, Cont <Proc> pK) { Cont.Do(pK, ref wr, pK.GetProc(ref wr)); }
internal override void DoCont(ref Worker wr, T value) { this.Cont.DoCont(ref wr, value); }
internal override void DoJob(ref Worker wr, Cont <Scheduler> sK) { Cont.Do(sK, ref wr, wr.Scheduler); }
internal override void Ready(IAsyncResult iar) { this.iar = iar; Worker.RunOnThisThread(sr, this); }
internal override void DoWork(ref Worker wr) { xK.DoCont(ref wr, xT.Result); }
internal override void DoWork(ref Worker wr) { xK.DoCont(ref wr, xJ.DoEnd(iar)); }
internal override Proc GetProc(ref Worker wr) { return(uK.GetProc(ref wr)); }
internal override void DoJob(ref Worker wr, Cont <X> xK) { DoBegin(StaticData.workAsyncCallback, new Callback(wr.Scheduler, this, xK)); }
internal void Ready() { Worker.RunOnThisThread(sr, this); }
internal override void DoCont(ref Worker wr, Unit value) { this.DoWork(ref wr); }
internal override void DoHandle(ref Worker wr, Exception e) { Handler.DoHandle(yK, ref wr, e); }
/// Internal implementation detail. internal abstract void DoWork(ref Worker wr);