RFR: jsr166 jdk9 integration wave 12

Paul Sandoz paul.sandoz at oracle.com
Fri Nov 18 16:52:12 UTC 2016


> On 18 Nov 2016, at 04:52, Doug Lea <dl at cs.oswego.edu> wrote:
> 
> 
>> On Thu, Nov 17, 2016 at 12:03 PM, Paul Sandoz <Paul.Sandoz at oracle.com
>> <mailto:Paul.Sandoz at oracle.com>> wrote:
>> 
>> 
>>    Semaphore
>>>> 
>>     633     /**
>>     634      * Acquires and returns all permits that are immediately
>>    available.
>>     635      * Upon return, zero permits are available.
>>     636      *
>>     637      * @return the number of permits acquired
>>     638      */
>>     639     public int drainPermits() {
>>     640         return sync.drainPermits();
>>     641     }
>> 
>>    Arguably, if positive acquires all permits, otherwise releases all
>>    permits. Perhaps:
> 
> Thank! That's a better way to phrase intent. Reworded to:
> 
>    /**
>     * Acquires and returns all permits that are immediately
>     * available, or if negative permits are available, releases them.
>     * Upon return, zero permits are available.
>     *
>     * @return the number of permits acquired or, if negative, the
>     * number released
>     */
> 

Looks good to me.


>> 
>>    Probably requires a CCC which i can manage.
>> 
> 
> Really?

Hmm… i don’t really wanna do it :-) but i suppose from the current specification it could be interpreted that no action is taken if there are negative permits. I believe submitter of the associated bug interpreted it that way.

> If so, please do.
> 

I’ll take the pain :-)

Paul.


More information about the core-libs-dev mailing list