mirror of https://github.com/deavmi/JavaOCP
parent
cc4b84354f
commit
580af3543a
|
@ -35,7 +35,7 @@ public class App
|
|||
// t2.join();
|
||||
// } catch (InterruptedException e) {}
|
||||
// }
|
||||
//
|
||||
|
||||
System.out.println("-------------------------------");
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue