protected virtual void AssertBeganWrite() { if (!wlock.IsHeldByCurrentThread ()) { throw new IOException ("thread must first call BeginWrite"); } }