From 7f51ae04c015d47b3bb4bbab0500192bdde9de93 Mon Sep 17 00:00:00 2001 From: IgorNB Date: Wed, 2 Oct 2019 19:56:19 +0300 Subject: [PATCH] Update SemaPhoreDemo.java --- .../java/com/baeldung/concurrent/semaphore/SemaPhoreDemo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {