Java - Código JAVA hilo finalice

 
Vista:

Código JAVA hilo finalice

Publicado por gorka_sm (17 intervenciones) el 13/12/2011 11:20:38
Hola a tod@s :


¿ Cómo se puede poner en código JAVA que se está esperando a que un hilo finalize ?
Saludos
Gorka
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Código JAVA hilo finalice

Publicado por anonimouse (1 intervención) el 13/12/2011 13:31:40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
long time = System.currentTimeMillis();
time = time/1000;
Integer downTime = null;
try {
	downTime = 3600
	if ( null != thread ) {
		while ( !thread.isInterrupted() && thread.isAlive() ) {
			long currentTime = System.currentTimeMillis();
			currentTime = currentTime/1000;
			if( currentTime-time <= downTime ) {
				Thread.sleep( 2000L );
			} else {
				thread.interrupt();
			}
		}
	}
} catch (InterruptedException e) {
	e.printStackTrace();
} catch (S4DSBusinessException e1) {
	e1.printStackTrace();
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar