raniero
04-05-2006, 00:09
Ciao a tutti..
nel mio programma ho 4 thread, vorrei implementare un metodo che aumenta di uno la priorità di un singolo thread ogni volta che va in wait().. Come potrei fare?
io ho provato con questo metodo:
public void aumentaPriorita() {
       
        
Thread.currentThread().setPriority(Thread.currentThread().getPriority() + 1);
Main.log.writeINF("AUMENTATA PRIORITA' a thread " + Thread.currentThread().getName() + " " + Thread.currentThread().getPriority() + ">");
        
}
nel mio programma ho 4 thread, vorrei implementare un metodo che aumenta di uno la priorità di un singolo thread ogni volta che va in wait().. Come potrei fare?
io ho provato con questo metodo:
public void aumentaPriorita() {
Thread.currentThread().setPriority(Thread.currentThread().getPriority() + 1);
Main.log.writeINF("AUMENTATA PRIORITA' a thread " + Thread.currentThread().getName() + " " + Thread.currentThread().getPriority() + ">");
}