code: public boolean removeWriter(Object key, Object resourceId)
      {
          boolean result = false;
          ObjectLocks objectLocks = null;
          synchronized(locktable)
          {
              objectLocks = (ObjectLocks) locktable.get(resourceId);
              if(objectLocks != null)
              {
                  /**
                   * MBAIRD, last one out, close the door and turn off the lights.
                   * if no locks (readers or writers) exist for this object, let's remove
                   * it from the locktable.
                   */
                  LockEntry entry = objectLocks.getWriter();
                  if(entry != null && entry.isOwnedBy(key))
                  {
                      objectLocks.setWriter(null);
                      result = true;
  
                      // no need to check if writer is null, we just set it.
                      if(objectLocks.getReaders().size() == 0)
                      {
                          locktable.remove(resourceId);
                      }
                  }
              }
          }
          return result;
      }
docs: Remove an write lock.