code: func (rw *BoundedRWLock) WLock(timeout time.Duration) (err error) {
  	deadline := time.After(timeout)
  	rw.control.Lock()
  	if rw.readers != 0 || rw.nextWriter != nil {
  		me := newWait(true)
  		if rw.nextWriter == nil {
  			rw.nextWriter = me
  		} else {
  			select {
  			case rw.waiters <- me:
  			default:
  				err = errors.New("Waiter capacity reached in WLock")
  			}
  		}
  		rw.control.Unlock()
  		if err != nil {
  			return
  		}
  
  		woken := me.WaitAtomic(deadline)
  		if !woken {
  			return errors.New("Waiter timeout")
  		}
  		rw.control.Lock()
  		if rw.readers != 0 {
  			panic("readers??")
  		}
  		if rw.nextWriter != me {
  			panic("not me??")
  		}
  	} else {
  		rw.nextWriter = newWait(true)
  	}
  	rw.control.Unlock()
  	return
  }
docs: // Lock for writing, waiting up to 'timeout' for successful exclusive
  // acquisition of the lock.