/** * Add a computation to be executed. */ public void Slot(Computation computation) { if (computation is Lookup) { var lookup = (Lookup)computation; inflight[lookup] = true; computation.Notify(x => inflight.Remove(lookup)); } computations.Enqueue(computation); }
public void Prepare(Computation c) { c.Notify(result => { this.Result = result; reset_event.Set(); if (Interlocked.Decrement(ref interlock) == 0) { owner.task_master.Slot(owner); } }); if (Interlocked.Decrement(ref interlock) == 0) { CompletedSynchronously = true; Continue(); } }
protected override bool Run() { source.Notify(HandleFrameResult); task_master.Slot(source); return(false); }