Biblioteca Java - Rev 28
Subversion Repositories:
/*
* FirGet.java
*/
package exemple.fire.sincronizare;
/**
* Class created by @author Mihai HULEA at Feb 23, 2005.
*
* This class is part of the labs project.
*
*/
public class FirGet extends Thread {
Punct p;
public FirGet(Punct p){
this.p = p;
}
public void run(){
int i=0;
int a,b;
while(++i<15){
// synchronized(p){
a= p.getX();
try {
sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
b = p.getY();
// }
System.out.println("Am citit: ["+a+","+b+"]");
}
}
public static void main(String[] args) {
}
}
* FirGet.java
*/
package exemple.fire.sincronizare;
/**
* Class created by @author Mihai HULEA at Feb 23, 2005.
*
* This class is part of the labs project.
*
*/
public class FirGet extends Thread {
Punct p;
public FirGet(Punct p){
this.p = p;
}
public void run(){
int i=0;
int a,b;
while(++i<15){
// synchronized(p){
a= p.getX();
try {
sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
b = p.getY();
// }
System.out.println("Am citit: ["+a+","+b+"]");
}
}
public static void main(String[] args) {
}
}