commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LANG-1275) Add a tryAcquire() method to TimedSemaphore
Date Mon, 10 Oct 2016 20:24:20 GMT

     [ https://issues.apache.org/jira/browse/LANG-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oliver Heger resolved LANG-1275.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 3.5

Fixed in Git with commit 78134f6b3f1facd019e604d2cd000c4ce7cf9a0a.

> 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
>             Fix For: 3.5
>
>         Attachments: LANG_1275.patch
>
>
> 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)

Mime
View raw message