code: func (w *window) reserve(win uint32) (uint32, error) {
  	var err error
  	w.L.Lock()
  	w.writeWaiters++
  	w.Broadcast()
  	for w.win == 0 && !w.closed {
  		w.Wait()
  	}
  	w.writeWaiters--
  	if w.win < win {
  		win = w.win
  	}
  	w.win -= win
  	if w.closed {
  		err = io.EOF
  	}
  	w.L.Unlock()
  	return win, err
  }
docs: // reserve reserves win from the available window capacity.
  // If no capacity remains, reserve will block. reserve may
  // return less than requested.