code: protected void modify(Transaction t) {
          try {
              this.lock.writeLock().lock();
              t.perform();
          } finally {
              this.lock.writeLock().unlock();
          }
      }
docs: Executes the given transaction within the context of a write lock.
  
  @param t The transaction to execute.