countingsemaphore.java
来自「a simple java mutlti thread concurrency 」· Java 代码 · 共 12 行
JAVA
12 行
package Synchronization;// is final so subclassing cannot upset if (...) wait() and notify()// but notify() (and wait() too) are public methods so still risky;// better to create a private object and do notify(), wait() inside itpublic final class CountingSemaphore extends Semaphore { public CountingSemaphore() {super();} // constructors public CountingSemaphore(int initial) {super(initial);}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?