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

Gary D. Gregory resolved LANG-1790.
-----------------------------------
    Fix Version/s: 3.21.1
       Resolution: Fixed

Implemented in git master and [snapshot 
builds|https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-lang3/3.22.0-SNAPSHOT/].

> Fairness setting in TimedSemaphore
> ----------------------------------
>
>                 Key: LANG-1790
>                 URL: https://issues.apache.org/jira/browse/LANG-1790
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.concurrent.*
>            Reporter: Mert Kirpici
>            Priority: Major
>             Fix For: 3.21.1
>
>
> The {{TimedSemaphore}} structure javadocs do not mention anything about 
> fairness.
> If this is something that the current implementation does not provide, the 
> {{TimedSemaphore}} structure could benefit from a _fairness_ setting like the 
> {{java.util.concurrent.Semaphore}} does, which will queue up the threads that 
> are blocked by the {{.acquire()}} call and when the timer expires, they will 
> be permitted access to the shared resource in a FIFO fashion.
> A possible implementation could be like this in the constructor:
> {{TimedSemaphore(long timePeriod, TimeUnit timeUnit, int limit, boolean 
> fair)}}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to