Biblioteca Java - Blame information for rev 3
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
3 | mihai | 1 | /* |
2 | * FirSet.java | ||
3 | */ | ||
4 | package lab.scd.fire.sincronizare; | ||
5 | |||
6 | /** | ||
7 | * Class created by @author Mihai HULEA at Feb 23, 2005. | ||
8 | * | ||
9 | * This class is part of the labs project. | ||
10 | * | ||
11 | */ | ||
12 | public class FirSet extends Thread { | ||
13 | |||
14 | Punct p; | ||
15 | |||
16 | public FirSet(Punct p){ | ||
17 | this.p = p; | ||
18 | } | ||
19 | |||
20 | public void run(){ | ||
21 | int i =0; | ||
22 | while(++i<15){ | ||
23 | int a = (int)Math.round(10*Math.random()+10); | ||
24 | int b = (int)Math.round(10*Math.random()+10); | ||
25 | |||
26 | //synchronized(p){ | ||
27 | p.setXY(a,b); | ||
28 | // } | ||
29 | |||
30 | try { | ||
31 | sleep(10); | ||
32 | } catch (InterruptedException e) { | ||
33 | |||
34 | e.printStackTrace(); | ||
35 | } | ||
36 | System.out.println("Am scris: ["+a+","+b+"]"); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | |||
41 | |||
42 | public static void main(String[] args) { | ||
43 | } | ||
44 | } |