code: public boolean releaseLock() {
          LockInfo info = (LockInfo)mLockInfoRef.get();
          int type = info.mType;
          int count = info.mCount;
          if (count > 0) {
              count--;
          }
          else {
              info.mType = type = NONE;
              count = 0;
          }
  
          if ((info.mCount = count) == 0) {
              switch (type) {
              case NONE: default:
                  return false;
  
              case READ:
                  synchronized (this) {
                      mReadLocks--;
                      notifyAll();
                  }
                  break;
  
              case UPGRADABLE:
                  synchronized (this) {
                      mUpgradableLockHeld = null;
                      notifyAll();
                  }
                  break;
  
              case WRITE:
                  synchronized (this) {
                      mWriteLockHeld = null;
                      notifyAll();
                  }
                  break;
              }
  
              info.mType = NONE;
          }
          else if (type == WRITE && info.mUpgradeCount == count) {
              // Convert write lock back into an upgradable lock.
              info.mType = UPGRADABLE;
              info.mUpgradeCount = 0;
              synchronized (this) {
                  mWriteLockHeld = null;
                  notifyAll();
              }
          }
  
          return true;
      }
docs: Release the lock held by the current thread.
  
  @return false if this thread doesn't hold a lock.