Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8F7D3200B9E for ; Sat, 8 Oct 2016 16:46:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8E236160ADF; Sat, 8 Oct 2016 14:46:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C0CDC160AD1 for ; Sat, 8 Oct 2016 16:46:26 +0200 (CEST) Received: (qmail 35381 invoked by uid 500); 8 Oct 2016 14:46:20 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 35294 invoked by uid 99); 8 Oct 2016 14:46:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2016 14:46:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7AF772C2A66 for ; Sat, 8 Oct 2016 14:46:20 +0000 (UTC) Date: Sat, 8 Oct 2016 14:46:20 +0000 (UTC) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (LANG-1275) Add a tryAcquire() method to TimedSemaphore MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 08 Oct 2016 14:46:27 -0000 Oliver Heger created LANG-1275: ---------------------------------- Summary: Add a tryAcquire() method to TimedSemaphore Key: LANG-1275 URL: https://issues.apache.org/jira/browse/LANG-1275 Project: Commons Lang Issue Type: Improvement Components: lang.concurrent.* Affects Versions: 3.4 Reporter: Oliver Heger In order to support non-blocking use cases and be more in-line with Java's {{Semaphore}} class, {{TimedSemaphore}} should support a _tryAcquire()_ method: {code} public boolean tryAcquire(); {code} The method checks whether another permit can be acquired. If so, it acquires the permit and returns *true*. Otherwise, it returns *false* without blocking the calling thread. -- This message was sent by Atlassian JIRA (v6.3.4#6332)