git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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?


---



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-brooklyn-development/msg07782.html on line 88
Call Stack
#TimeMemoryFunctionLocation
10.0007363704{main}( ).../msg07782.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-brooklyn-development/msg07782.html on line 88
Call Stack
#TimeMemoryFunctionLocation
10.0007363704{main}( ).../msg07782.html:0