/**
* @throws Exception
*/
@Test
public void test2() throws Exception {
Semaphore semaphore = new Semaphore(10, true);
for (int i = 0; i < MAX_THREAD_COUNT; i++) {
new MultithreadingTest(i, semaphore, this).start();
if (i > 0 && i % 100 == 0) {
synchronized (this) {
while (counter != i) {
wait();
}
}
}
}
synchronized (this) {
while (counter != MAX_THREAD_COUNT) {
wait();
}
System.out.println("counter: " + counter);
}
}
ConvertOdtToPdfTest_OO.java 文件源码
java
阅读 46
收藏 0
点赞 0
评论 0
项目:doctemplate
作者:
评论列表
文章目录