private static void Unpin(UvWriteReq req) { foreach (var pin in req._pins) { pin.Free(); } req._pins.Clear(); }
private static void Unpin(UvWriteReq req) { foreach (var pin in req._pins) { pin.Free(); } req._pins.Clear(); foreach (var handle in req._handles) { handle.Dispose(); } req._handles.Clear(); }
public void Return(UvWriteReq req) { if (_disposed) { throw new ObjectDisposedException(GetType().Name); } if (_pool.Count < _maxPooledWriteReqs) { _pool.Enqueue(req); } else { req.Dispose(); } }
public UvWriteReq Allocate() { if (_disposed) { throw new ObjectDisposedException(GetType().Name); } UvWriteReq req; if (_pool.Count > 0) { req = _pool.Dequeue(); } else { req = new UvWriteReq(); req.Init(_thread.Loop); } return req; }
private void EndWrite(UvWriteReq writeReq) { _pendingWrites--; _thread.WriteReqPool.Return(writeReq); if (_drainWrites != null) { if (_pendingWrites == 0) { _drainWrites.TrySetResult(null); } } }
private static void WriteCallback(UvWriteReq writeReq, int status, object state) { ((UvTcpConnection)state).EndWrite(writeReq); }
private static void Unpin(UvWriteReq req) { foreach (var pin in req._pins) { pin.Free(); } req._pins.Clear(); }