SemaphoreDemo: Added comments
This commit is contained in:
@@ -29,6 +29,9 @@ class MyThread extends Thread
|
|||||||
|
|
||||||
public MyThread(Semaphore mySemPro, Semaphore mySemCon, 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);
|
super(threadName);
|
||||||
// We set the semaphores from the main method
|
// We set the semaphores from the main method
|
||||||
this.semPro = mySemPro;
|
this.semPro = mySemPro;
|
||||||
|
|||||||
Reference in New Issue
Block a user