-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLoading.java
More file actions
41 lines (35 loc) · 818 Bytes
/
Loading.java
File metadata and controls
41 lines (35 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package DBMS;
/**
* Created by Pawan on 15-04-2017.
*/
public class Loading extends Thread {
private String thread;
Loading(String thread)
{
this.thread=thread;
}
public void run(){
System.out.println("Sleep");
waiting();
try{sleep(10000);}
catch(Exception e){e.printStackTrace();}
notifying();
System.out.println("End Loading");
}
public void waiting()
{
synchronized (thread)
{
try {thread.wait();}
catch(Exception e){e.printStackTrace();}
}
}
public void notifying()
{
synchronized (thread)
{
try {thread.notifyAll();}
catch(Exception e){e.printStackTrace();}
}
}
}