RFR: jsr166 jdk9 integration wave 12
Martin Buchholz
martinrb at google.com
Fri Nov 18 04:51:37 UTC 2016
On Thu, Nov 17, 2016 at 12:03 PM, Paul Sandoz <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:
>
> Acquires and returns all permits that are immediately available,
> otherwise releases all permits (if negative).
> Upton return, zero permits are available.
>
> @return the number of permits acquired, or the number of permits release
> (a negative value)
>
> Probably requires a CCC which i can manage.
>
I agree we can do better along the lines you suggest. I'm hesitant since I
don't understand the intended use for drainPermits.
More information about the core-libs-dev
mailing list