commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] [Created] (LANG-1275) Add a tryAcquire() method to TimedSemaphore
Date Sat, 08 Oct 2016 14:46:20 GMT
Oliver Heger created LANG-1275:

             Summary: Add a tryAcquire() method to TimedSemaphore
                 Key: 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:

public boolean tryAcquire();

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

View raw message