Advertisement
FacundoCruz

HiloD

May 12th, 2022
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. package tp05;
  2.  
  3. public class HiloD extends Thread{
  4.  
  5. public HiloD() {}
  6.  
  7.  
  8. public void run() {
  9.  
  10. RegionCritica cuenta = new RegionCritica();
  11.  
  12. for(int i=1;i<=40;i++) {
  13.  
  14. Deposito hiloD = new Deposito(cuenta);
  15.  
  16. hiloD.start();
  17.  
  18. try {
  19.  
  20. sleep(30);
  21.  
  22. } catch (InterruptedException e) {
  23. // TODO: handle exception
  24. }
  25. }
  26.  
  27. }
  28.  
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement