Update SemaPhoreDemo.java

This commit is contained in:
IgorNB 2019-10-02 19:56:19 +03:00 committed by GitHub
parent efb631f017
commit 7f51ae04c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ public class SemaPhoreDemo {
System.out.println("Available permit : " + semaphore.availablePermits());
System.out.println("Number of threads waiting to acquire: " + semaphore.getQueueLength());
if (semaphore.tryAcquire())
if (semaphore.tryAcquire()) {
try {
// perform some critical operations
} finally {