public override Present Realize(string refCredit) { Monitor.Enter(this); Present result; try { if (this.activeAsyncRef != null) { result = this.activeAsyncRef.Duplicate(refCredit); } else { D.Assert(!this.realizing); this.realizing = true; this.activeAsyncRef = (AsyncRef)this.future.Realize("ODSPF"); AsyncRef asyncRef = (AsyncRef)this.activeAsyncRef.Duplicate(refCredit); this.prioritizer.Realizing(this); this.activeAsyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.AsyncCompleteCallback)); result = asyncRef; } } finally { Monitor.Exit(this); } return result; }
public PersistentInterest(AsyncRef asyncRef) { this.interestList = new InterestList(); this.interestList.Add(asyncRef); this.interestList.Activate(); asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.AsyncCompleteCallback)); }
public override Present Realize(string refCredit) { Monitor.Enter(this); Present result; try { if (activeAsyncRef != null) { result = activeAsyncRef.Duplicate(refCredit); } else { D.Assert(!realizing); realizing = true; activeAsyncRef = (AsyncRef)future.Realize("ODSPF"); AsyncRef asyncRef = (AsyncRef)activeAsyncRef.Duplicate(refCredit); prioritizer.Realizing(this); activeAsyncRef.AddCallback(AsyncCompleteCallback); result = asyncRef; } } finally { Monitor.Exit(this); } return(result); }
private void RendererSanityCheckComplete(AsyncRef asyncRef) { Monitor.Enter(this); try { if (this.handled) { return; } this.handled = true; } finally { Monitor.Exit(this); } if (!(asyncRef.present is ImageRef)) { if (asyncRef.present is RequestCanceledPresent) { new InsaneSourceMapRemover(this.sourceMap, this.mapTileSourceFactory, this.undoAddSourceMapDelegate, this.tryCount + 1); return; } string message; if (asyncRef.present is PresentFailureCode) { message = ((PresentFailureCode)asyncRef.present).exception.Message; } else { message = string.Format("Unexpected result type {0}", asyncRef.present.GetType().ToString()); } this.undoAddSourceMapDelegate(message); return; } }
public AsyncRecord(AsyncScheduler scheduler, IFuture cacheKeyToEvict, IFuture future) { this._cacheKeyToEvict = cacheKeyToEvict; this._future = future; this.scheduler = scheduler; this._present = null; this.asyncState = AsyncState.Prequeued; this.queuePriority = 0; this.qtpRef = new AsyncRef(this, "qRef"); }
public AsyncRecord(AsyncScheduler scheduler, IFuture cacheKeyToEvict, IFuture future) { this.cacheKeyToEvict = cacheKeyToEvict; this.future = future; this.scheduler = scheduler; present = null; asyncState = AsyncState.Prequeued; queuePriority = 0; qtpRef = new AsyncRef(this, "qRef"); }
private void AsyncCompleteCallback(AsyncRef asyncRef) { Monitor.Enter(this); try { this.realizing = false; this.prioritizer.Complete(this); this.activeAsyncRef.Dispose(); this.activeAsyncRef = null; } finally { Monitor.Exit(this); } }
private void AsyncCompleteCallback(AsyncRef asyncRef) { Monitor.Enter(this); try { realizing = false; prioritizer.Complete(this); activeAsyncRef.Dispose(); activeAsyncRef = null; } finally { Monitor.Exit(this); } }
public override Present Realize(string refCredit) { Present present = this.asyncFuture.Realize(refCredit); if (present is AsyncRef) { AsyncRef asyncRef = (AsyncRef)present; asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.PresentReadyCallback)); asyncRef.SetInterest(this.interestValue); AsyncRef asyncRef2 = (AsyncRef)asyncRef.Duplicate(refCredit + "2"); new PersistentInterest(asyncRef); this.asyncReadyEvent.WaitOne(); return(asyncRef2.present); } return(present); }
public void Dispose() { Monitor.Enter(this); try { if (activeAsyncRef != null) { activeAsyncRef.Dispose(); activeAsyncRef = null; } } finally { Monitor.Exit(this); } }
private void Notify(Present presentValue) { Monitor.Enter(this); try { D.Assert(this._present == null); this._present = presentValue; this.notificationRef = new AsyncRef(this, "callback"); this.qtpRef = null; } finally { Monitor.Exit(this); } DebugThreadInterrupter.theInstance.AddThread("AsyncRecord.NotifyThread", new ThreadStart(this.NotifyThread), ThreadPriority.Normal); }
public void AddCallback(AsyncRecord.CompleteCallback callback) { Monitor.Enter(this); try { if (this.present != null) { AsyncRef asyncRef = new AsyncRef(this, "AsyncRecord.AddCallback"); callback(asyncRef); asyncRef.Dispose(); } else { this.callbackEvent = (AsyncRecord.CompleteCallback)Delegate.Combine(this.callbackEvent, callback); } } finally { Monitor.Exit(this); } }
public void AddCallback(CompleteCallback callback) { Monitor.Enter(this); try { if (present != null) { AsyncRef asyncRef = new AsyncRef(this, "AsyncRecord.AddCallback"); callback(asyncRef); asyncRef.Dispose(); } else { callbackEvent = (CompleteCallback)Delegate.Combine(callbackEvent, callback); } } finally { Monitor.Exit(this); } }
internal void ChangePriority(AsyncRef asyncRef) { this.qtp.ChangePriority(asyncRef); }
private void BoundsRefAvailable(AsyncRef asyncRef) { base.Invalidate(); }
public void AsyncRecordComplete(AsyncRef asyncRef) { if (this.viewerControl.asyncRequestGeneration == this.generation) { this.viewerControl.InvalidateView(); } }
public void AsyncCompleteCallback(AsyncRef boundsAsyncRef) { this.interestList.Dispose(); }
internal void EvictFromCache(AsyncRef aref) { this.asyncRecordCache.Evict(aref.asyncRecord.cacheKeyToEvict); }
private void PresentReadyCallback(AsyncRef asyncRef) { this.asyncReadyEvent.Set(); }
public void Add(AsyncRef aref) { this.list.AddLast(aref); }
private void ImageBoundsAvailable(AsyncRef asyncRef) { this.StoreRenderRegion(asyncRef.present); }
public void Dispose() { Monitor.Enter(this); try { if (this.activeAsyncRef != null) { this.activeAsyncRef.Dispose(); this.activeAsyncRef = null; } } finally { Monitor.Exit(this); } }
public void Callback(AsyncRef asyncRef) { this.lop.AsyncReadyCallback(this); }
private void PresentReadyCallback(AsyncRef asyncRef) { asyncReadyEvent.Set(); }