Michael Kublin has uploaded a new change for review. Change subject: core: Removing unneeded signalAll ......................................................................
core: Removing unneeded signalAll The following patch should remove unneeded signalAll from InMemoryLockManager.acquireLockWait The following signallAll is not needed because of all threads will weak up during releaseLock. The signalAll removed from InMemoryLockManager.acquireLockWait in order not to cause unneeded busy wait for waiting threads Change-Id: I21974c2043eee97edaf09a7006a2ac6f25c6e194 Signed-off-by: Michael Kublin <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java 1 file changed, 1 insertion(+), 11 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/7561/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java index 7594009..e899f09 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java @@ -85,22 +85,12 @@ validateLockForAcquireAndWait(lock); globalLock.lock(); try { - boolean firstRun = true; while (!acquireLockInternal(lock)) { - // In case of first try, just wait - if (firstRun) { - firstRun = false; - } else { - // This is a second try, we did not successes, but possible that release signal for other waiting - // thread - // so try to signal to other threads - releasedLock.signalAll(); - } log.infoFormat("Failed to acquire lock and wait lock {0}", lock); releasedLock.await(); } } catch (InterruptedException e) { - releasedLock.signal(); + } finally { globalLock.unlock(); } -- To view, visit http://gerrit.ovirt.org/7561 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21974c2043eee97edaf09a7006a2ac6f25c6e194 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Michael Kublin <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
