Exemplo n.º 1
0
            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");
                    }
                }
            }
Exemplo n.º 2
0
 public IEDP()
 {
     i             = 0;
     _pageDelegate = SelfPageDelegate;
 }