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

Hanson Char hanson.char at gmail.com
Tue Dec 23 12:18:13 EST 2014


The modified javadoc on Semaphore looks much clearer now (about it's
limited use on multiple permits).  I especially like the added example.
Thanks !

> One moral from all this is that we should contemplate introduction of
some kind of priority-based synchronizer.

Sounds intriguing and useful.

Regards,
Hanson

On Tue, Dec 23, 2014 at 5:39 AM, Doug Lea <dl at cs.oswego.edu> wrote:

> 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
>
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141223/20bad5e9/attachment.html>


More information about the Concurrency-interest mailing list