SemaphoreDemo: Added comments

This commit is contained in:
2025-03-19 20:00:56 +01:00
parent ab6ad3dcc7
commit 8c12a1a904

View File

@@ -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;