[concurrency-interest] Semaphore doc bug [Was: Enforcing ordered execution of critical sections?]

Doug Lea dl at cs.oswego.edu
Tue Dec 23 08:39:38 EST 2014


On 12/23/2014 06:45 AM, Doug Lea wrote:
> On 12/23/2014 01:19 AM, Joe Bowbeer wrote:
> Hopefully the doc improvements will prevent this from happening again.

I committed these to jsr166 CVS, plus the additional clarification in
acquire(int):

      * <p>Acquires the given number of permits, if they are available,
      * and returns immediately, reducing the number of available permits
      * by the given amount. This method has the same effect as the
      * loop {@code for (int i = 0; i < permits; ++i) acquire();} except
      * that it atomically acquires the permits all at once:

See http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/Semaphore.html

-Doug





More information about the Concurrency-interest mailing list