From 8c12a1a9049bd8796ad98a8968058e7cf53cd10f Mon Sep 17 00:00:00 2001 From: Karsten Jeppesen Date: Wed, 19 Mar 2025 20:00:56 +0100 Subject: [PATCH] SemaphoreDemo: Added comments --- Technology/SemaphoreDemo/src/ProCon.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Technology/SemaphoreDemo/src/ProCon.java b/Technology/SemaphoreDemo/src/ProCon.java index 213c41c..2388b94 100644 --- a/Technology/SemaphoreDemo/src/ProCon.java +++ b/Technology/SemaphoreDemo/src/ProCon.java @@ -28,7 +28,10 @@ class MyThread extends Thread String threadName; public MyThread(Semaphore mySemPro, Semaphore mySemCon, String threadName) - { + { + // The Thread class constructor that takes a String argument creates + // a Thread with a specific name + // (as opposed to automatically generated names such as Thread-1). super(threadName); // We set the semaphores from the main method this.semPro = mySemPro;