摘要: Semaphore (JDK) 我们使用semaphore去限制获取特定资源的并发线程数量。 下面的例子中,我们实现了一个简单的登录队列来限制登入系统的用户数量: class LoginQueueUsingSemaphore { private Semaphore semaphore; public 阅读全文
posted @ 2020-06-18 23:07 Mr靖哥哥 阅读(257) 评论(0) 推荐(0) 编辑