Java线程的挂起与唤醒

private Thread mythread;

public void start()

if (mythread==null){

mythread=new Thread();

mythread.start();

}

else { 

mythread.resume();

}

}
public void run()

{  

while(true) {   

try{

sleep(100);

        catch(InterruptedException e) {}

}

}
public void stop()

{

mythread.suspend();

}

你可能感兴趣的:(java,thread,编程,线程)