From dev-return-67330-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Tue Sep 25 19:07:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7CA3D18061A for ; Tue, 25 Sep 2018 19:07:26 +0200 (CEST) Received: (qmail 15838 invoked by uid 500); 25 Sep 2018 17:07:25 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 15810 invoked by uid 99); 25 Sep 2018 17:07:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2018 17:07:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AE79AE0BCB; Tue, 25 Sep 2018 17:07:24 +0000 (UTC) From: michaelandrepearce To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #2328: ARTEMIS-2095 - Typed Properties ThreadS... Content-Type: text/plain Message-Id: <20180925170724.AE79AE0BCB@git1-us-west.apache.org> Date: Tue, 25 Sep 2018 17:07:24 +0000 (UTC) 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 withWriteLock(Supplier supplier) { + long lock = this.writeLock(); + try { + return supplier.get(); + } finally { + this.unlockWrite(lock); + } + } + + private T withReadLock(Supplier 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.... ---