activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelandrepearce <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #2328: ARTEMIS-2095 - Typed Properties ThreadS...
Date Tue, 25 Sep 2018 17:07:24 GMT
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2328#discussion_r220276768
  
    --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java
---
    @@ -1056,4 +1107,26 @@ public static void setObjectProperty(final SimpleString key, final
Object value,
              throw new ActiveMQPropertyConversionException(value.getClass() + " is not a
valid property type");
           }
        }
    +
    +
    +
    +   private <T> T withWriteLock(Supplier<T> supplier) {
    +      long lock = this.writeLock();
    +      try {
    +         return supplier.get();
    +      } finally {
    +         this.unlockWrite(lock);
    +      }
    +   }
    +
    +   private <T> T withReadLock(Supplier<T> supplier) {
    --- End diff --
    
    i meant that positively, i just realised might not read as well i as i meant it too....
i like the construstive comment :) , making me think again....


---

Mime
View raw message