示例#1
0
 void Flush (int index)
 {
     CachedBlock b = CachedBlocks[index];
     CachedBlocks.RemoveAt (index);
     Interlocked.Add (ref cacheUsed, -b.Count);
     Write (b.File, b.Offset, b.Buffer, 0, b.Count, true);
     ClientEngine.BufferPool.Return (b.Buffer);
 }
示例#2
0
        void Flush(int index)
        {
            CachedBlock b = CachedBlocks[index];

            CachedBlocks.RemoveAt(index);
            Interlocked.Add(ref cacheUsed, -b.Count);
            using (b.BufferReleaser)
                Write(b.File, b.Offset, b.Buffer, 0, b.Count, true);
        }
示例#3
0
        async ReusableTask FlushAsync(int index)
        {
            CachedBlock b = CachedBlocks[index];

            CachedBlocks.RemoveAt(index);
            Interlocked.Add(ref cacheUsed, -b.Count);

            using (b.BufferReleaser)
                await WriteAsync(b.File, b.Offset, b.Buffer, 0, b.Count, true);
        }