public class SemaphoreMain {
public static void main(String[] args) {
PrintQueue queue = new PrintQueue();
Job job = new Job(queue);
Thread thread[] = new Thread[10];
for (int i = 0; i < 10; i++) {
// 运行1或2对程序有什么影响?
//1. thread[i] = new Thread(job, "Thread" + i);
//2. thread[i] = new Thread(new Job(queue));
}
for (int i = 0; i < 10; i++) {
thread[i].start();
}
}
}