Uri*_*Uri 4 java concurrency
我正在尝试理解Java Semaphore类中的drainPermits的合同
JavaDoc只是读取:
public int drainPermits() Acquire and return all permits that are immediately available. Returns: the number of permits Run Code Online (Sandbox Code Playgroud)
public int drainPermits()
Acquire and return all permits that are immediately available. Returns: the number of permits
如果目前没有许可证,它是否会阻止并等到有可用许可证?
Jon*_*eet 9
不,它会立即返回0.它不需要任何许可证.
归档时间:
16 年,4 月 前
查看次数:
1634 次
最近记录: