You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by geomacy <gi...@git.apache.org> on 2018/06/04 15:56:11 UTC
[GitHub] brooklyn-server pull request #966: Persistence efficient: unchanged and tran...
Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/966#discussion_r192791782
--- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/persist/StoreObjectAccessorLocking.java ---
@@ -225,6 +225,21 @@ public void waitForCurrentWrites(Duration timeout) throws InterruptedException,
}
}
+ @Override
+ public boolean isWriting() {
+ try {
+ boolean locked = lock.readLock().tryLock(0, TimeUnit.MILLISECONDS);
--- End diff --
Just a question - won't this fail to get the lock if another thread has a _read_ lock already - so `isWriting` will return `true` - even though nothing may have a write lock? Even if that's true, does it matter?
---