现在是测试信号标志的程序:
class Process extends Thread{
String op;
Semaphore sem;
Process(String name,String op,Semaphore sem){
super(name);
this.op=op;
this.sem=sem;
start();
}
public void run(){
if(op.compareTo("read")==0){
System.out.println("Trying to get readLock:"+getName());
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/