Method unlocks this instance.

@param maintainer the instance which currently holds the lock.

@throws CouldNotPerformException is thrown if the instance could not be
unlocked.
433765
@Override
    public void unlock(final Object maintainer) throws CouldNotPerformException {
        synchronized (maintainerLock) {
            if (this.maintainer != null && this.maintainer != maintainer) {
                throw new CouldNotPerformException("Could not unlock remote because it is locked by another instance!");
            }
            this.maintainer = null;
        }
    }
574796
private boolean shouldBeLogged(Throwable t, OSGiTraceComponent tc, ExtendedLogEntry logEntry) {
        while (t != null) {
            if (t instanceof IllegalStateException && COULD_NOT_OBTAIN_LOCK_EXCEPTION.equals(t.getMessage())) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "DS could not obtain a lock. This is not an error, but may indicate high system load",
                            getObjects(logEntry, false));
                }
                return false;
            }
            t = t.getCause();
        }
        return true;
    }
563580
private void lock(Object obtainer) throws PSQLException {
    if (lockedFor == obtainer) {
      throw new PSQLException(GT.tr("Tried to obtain lock while already holding it"),
          PSQLState.OBJECT_NOT_IN_STATE);

    }
    waitOnLock();
    lockedFor = obtainer;
  }
464893
@Override
    public void lock(Object entity, LockModeType lockMode)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.lock(" + entity + ',' + lockMode + ");\n" + toString());

        getEMInvocationInfo(true).lock(entity, lockMode);
    }
841879
void tryUnlockCurrent() {

        if ((m_lockAction != null) && m_lockAction.getChange().equals(CmsLockActionRecord.LockChange.locked)) {
            try {
                A_CmsUI.getCmsObject().unlockResource(m_currentResource);
            } catch (CmsException e) {
                e.printStackTrace();
            }
        }
    }
109698
public synchronized void unlock()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "unlock", this);

    // If the subscription locks are down to zero then notify the threads waiting
    // for the subscriptionTable lock.
    synchronized (iMutex)
    {
      // If we are exclusively locked, then just return, as long as
      // the thread that is calling is the thread that holds the
      // exclusive lock.
      if (iExclusivelyLocked && iExclusiveLockHolder == Thread.currentThread())
      {
        if (tc.isEntryEnabled())
          SibTr.exit(tc, "unlock");
        return;
      }

      // Decrement the lock count and notify the other threads if no 
      // one holds the lock any more.
      if (--iLockCount == 0)
        notifyAll();
        
      if (iLockCount < 0)
      {      
        if (tc.isEntryEnabled()) 
          SibTr.exit(tc, "unlock", "SIErrorException");
        
        SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
          new Object[] {
            "com.ibm.ws.sib.processor.utils.LockManager",
            "1:196:1.19" });
          
        throw new SIErrorException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0001",
            new Object[] {
              "com.ibm.ws.sib.processor.utils.LockManager",
              "1:203:1.19" },
            null));
      }        
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "unlock");
  }
61027
@Override
    public ENTRY update(final ENTRY entry) throws CouldNotPerformException {
        if (entry == null) {
            throw new NotAvailableException("entry");
        }
        log("Update " + entry + "...");
        try {
            checkWriteAccess();
            lock();
            try {
                try {
                    // validate update
                    if (!entryMap.containsKey(entry.getId())) {
                        throw new InvalidStateException("Entry not registered!");
                    }
                    // perform update
                    sandbox.update(entry);
                    // check if the new message results in an update after consistency checks
                    final boolean changed = !isSandbox() && ((sandbox instanceof MockRegistrySandbox) || !get(entry).equals(sandbox.get(entry)));
                    pluginPool.beforeUpdate(entry);
                    entryMap.put(entry.getId(), entry);
                    finishTransaction();
                    pluginPool.afterUpdate(entry);
                    // test if the entry has changed at all by this update method
                    if (changed) {
                        notifySuccessfulTransaction();
                    }
                } finally {
                    syncSandbox();
                }
            } finally {
                unlock();
            }
        } catch (CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not update " + entry + " in " + this + "!", ex);
        }
        notifyObservers();
        return get(entry);
    }
456782
public function unlock()
    {
        $this->count--;

        if ($this->count < 0) {
            $this->count = 0;
            return false;
        }

        if (0 === $this->count) {
            $this->entityManager->flush();

            return true;
        }

        return false;
    }
406622
protected final void unLock(ObjectManagerState objectManagerState)
    {
        synchronized (objectManagerState.transactionUnlockSequenceLock) {
            unlockSequence = objectManagerState.getNewGlobalTransactionUnlockSequence();
            lockingTransaction = null;
        } // synchronized.
    }
602266
public void unlockLastInode() {
    Preconditions.checkState(endsInInode());
    Preconditions.checkState(!mEntries.isEmpty());

    mLockedInodes.remove(mLockedInodes.size() - 1);
    mEntries.remove(mEntries.size() - 1).mLock.close();
    mLockMode = LockMode.READ;
  }
422583
@Override
    public boolean isLocked()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "isLocked");

        final boolean isLocked = (state == SIMPState.LOCKED);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "isLocked", Boolean.valueOf(isLocked));

        return isLocked;
    }
713745
@Override
    protected void beforeWaitForSynchronization(final T message) throws CouldNotPerformException {
        transactionIdField = ProtoBufFieldProcessor.getFieldDescriptor(message, TransactionIdProvider.TRANSACTION_ID_FIELD_NAME);
        if (transactionIdField == null) {
            throw new NotAvailableException("transaction id field for message[" + message.getClass().getSimpleName() + "]");
        }

        if (transactionIdField.getType() != Type.UINT64) {
            throw new CouldNotPerformException("Transaction id field of message[" + message.getClass().getSimpleName() + "] has an unexpected type[" + transactionIdField.getType().name() + "]");
        }
    }
1115764
public void unlock(final Task task, final Interval interval)
  {
    giant.lock();

    try {
      final String dataSource = task.getDataSource();
      final NavigableMap<DateTime, SortedMap<Interval, List<TaskLockPosse>>> dsRunning = running.get(task.getDataSource());

      if (dsRunning == null || dsRunning.isEmpty()) {
        return;
      }

      final SortedMap<Interval, List<TaskLockPosse>> intervalToPosses = dsRunning.get(interval.getStart());

      if (intervalToPosses == null || intervalToPosses.isEmpty()) {
        return;
      }

      final List<TaskLockPosse> possesHolder = intervalToPosses.get(interval);
      if (possesHolder == null || possesHolder.isEmpty()) {
        return;
      }

      final List<TaskLockPosse> posses = possesHolder.stream()
                                                     .filter(posse -> posse.containsTask(task))
                                                     .collect(Collectors.toList());

      for (TaskLockPosse taskLockPosse : posses) {
        final TaskLock taskLock = taskLockPosse.getTaskLock();

        // Remove task from live list
        log.info("Removing task[%s] from TaskLock[%s]", task.getId(), taskLock.getGroupId());
        final boolean removed = taskLockPosse.removeTask(task);

        if (taskLockPosse.isTasksEmpty()) {
          log.info("TaskLock is now empty: %s", taskLock);
          possesHolder.remove(taskLockPosse);
        }

        if (possesHolder.isEmpty()) {
          intervalToPosses.remove(interval);
        }

        if (intervalToPosses.isEmpty()) {
          dsRunning.remove(interval.getStart());
        }

        if (running.get(dataSource).size() == 0) {
          running.remove(dataSource);
        }

        // Wake up blocking-lock waiters
        lockReleaseCondition.signalAll();

        // Remove lock from storage. If it cannot be removed, just ignore the failure.
        try {
          taskStorage.removeLock(task.getId(), taskLock);
        }
        catch (Exception e) {
          log.makeAlert(e, "Failed to clean up lock from storage")
             .addData("task", task.getId())
             .addData("dataSource", taskLock.getDataSource())
             .addData("interval", taskLock.getInterval())
             .addData("version", taskLock.getVersion())
             .emit();
        }

        if (!removed) {
          log.makeAlert("Lock release without acquire")
             .addData("task", task.getId())
             .addData("interval", interval)
             .emit();
        }
      }
    }
    finally {
      giant.unlock();
    }
  }
1156633
@Override
	public final void lock(int handle) throws DataStoreException 
    {
        if (SAFE_MODE) checkHandle(handle);
        if (!locks.flip(handle))
        {
            locks.flip(handle); // Restore state
            throw new DataStoreException("Handle already locked : "+handle);
        }
    }
245010
public synchronized boolean lock() throws KeeperException, InterruptedException {
        if (isClosed()) {
            return false;
        }
        ensurePathExists(dir);

        return (Boolean) retryOperation(zop);
    }
1097906
public void setLifecycleOwner(@Nullable LifecycleOwner lifecycleOwner) {
        this.lifecycleOwner = lifecycleOwner;
        for (View view : views) {
            ViewDataBinding binding = DataBindingUtil.getBinding(view);
            if (binding != null) {
                binding.setLifecycleOwner(lifecycleOwner);
            }
        }
    }
102996
public static String messageAliasTableLocked(String lockOwner) {

        return Messages.get().key(Messages.GUI_ALIASES_TABLE_LOCKED_1, lockOwner);
    }