Sharpen.PipedInputStream.Allocate C# (CSharp) Method

Allocate() private method

private Allocate ( int len ) : int
len int
return int
        private int Allocate(int len)
        {
            int alen;
            while ((alen = TryAllocate (len)) == 0) {
                // Wait until somebody reads data
                try {
                    Monitor.Wait (thisLock);
                } catch {
                    closed = true;
                    dataEvent.Set ();
                    throw;
                }
            }
            return alen;
        }