public int TryGetNextPage() { GetNextPage act = null; while (act == null) { act = Interlocked.Exchange(ref _pageDelegate, null); } try { return(act()); } finally { var old = Interlocked.Exchange(ref _pageDelegate, act); if (old != null) { throw new Exception("Interlock failed in IEDP"); } } }
public IEDP() { i = 0; _pageDelegate = SelfPageDelegate; }