ConvertOdtToPdfTest_OO.java 文件源码

java
阅读 46 收藏 0 点赞 0 评论 0

项目:doctemplate 作者:
/**
 * @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);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号