# | Line 602 | Line 602 | public class Semaphore implements java.i | |
---|---|---|
602 | } | |
603 | ||
604 | /** | |
605 | < | * Acquires and returns all permits that are immediately available. |
605 | > | * Acquires and returns all permits that are immediately |
606 | > | * available, or if negative permits are available, releases them. |
607 | * Upon return, zero permits are available. | |
608 | * | |
609 | < | * @return the number of permits acquired |
609 | > | * @return the number of permits acquired or, if negative, the |
610 | > | * number released |
611 | */ | |
612 | public int drainPermits() { | |
613 | return sync.drainPermits(); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |