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(a)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(a)redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel(a)redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server