diff --git a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java b/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java index 153853a5b8..43261e5ee4 100644 --- a/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java +++ b/core-java-modules/core-java-concurrency-basic/src/main/java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java @@ -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 {