Change in ovirt-engine[master]: engine: Added AutoCloseableLock

mkolesni at redhat.com mkolesni at redhat.com
Sun Jul 13 17:16:29 UTC 2014


Mike Kolesnik has submitted this change and it was merged.

Change subject: engine: Added AutoCloseableLock
......................................................................


engine: Added AutoCloseableLock

This wrapper class will allow writing cleaner code, instead of:
lock.lock();
try {
    // Thread safe code
} finally {
    lock.unlock();
}

We can write:
try (AutoCloseableLock l = new AutoCloseableLock(lock)) {
    // Thread safe code
}

A follow-up patch will refactor code to use this new syntax and serve as
an example.

Change-Id: I3864d0e630c04f13e47e9f324414b308bd24290e
Signed-off-by: Mike Kolesnik <mkolesni at redhat.com>
---
A backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/lock/AutoCloseableLock.java
A backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/lock/AutoCloseableLockTest.java
2 files changed, 88 insertions(+), 0 deletions(-)

Approvals:
  Mike Kolesnik: Verified
  Omer Frenkel: Looks good to me, but someone else must approve
  Moti Asayag: Looks good to me, approved
  Yair Zaslavsky: Looks good to me, approved
  Oved Ourfali: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/29617
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3864d0e630c04f13e47e9f324414b308bd24290e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list