- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultithreading.java
More file actions
Latest commit
17 lines (17 loc) · 637 Bytes
/
Copy pathmultithreading.java
File metadata and controls
17 lines (17 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
publicclassmultithreading {
staticThreadGroupthG = newThreadGroup("ventanas");
staticintcontor=1, active=0; //contor remains 1 after first window, it starts increasing when 'new window' is pressed
publicstaticvoidnotifiedToStopThread(Stringname) {/// %%%
active--;
System.out.println("Inchidem threadul "+name);
Thread[] a = newThread[1000];
intn = Thread.enumerate(a);
for(inti = 0; i < n; i++) {
if(a[i].getName().equals(name)) {
System.out.println("Am identificat thread-ul de inchis");
a[i].interrupt();
break;
}
}
}/// %%%
}