📄 countingsemaphore.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -