Concurrency2

- Updated
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-17 13:39:04 +02:00
parent cc4b84354f
commit 580af3543a
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ public class App
// t2.join();
// } catch (InterruptedException e) {}
// }
//
System.out.println("-------------------------------");
/**

View File

@ -16,11 +16,11 @@ public class WorkerThread extends Thread
public void run()
{
int i = 0;
while(i < 100)
while(true)
{
lock.lock();
System.out.println("Thread '"+id+"' has lock");
/**
* Hold count which be the number of times
* this thread has locked this lock. If it