Transient modifier to sleeping thread?

Hi

I'm messing about with the 'transient' modifier when serializing a threaded object; I have written a delay into the thread to slow it down however the delay stops me from serializing it.

Does anyone know how I can apply the transient modifier to the following code?

Or perhaps give me a better way of pausing an active thread?

many thanks!

Dave

publicstaticvoid oneSec(){

try{

Thread.currentThread().sleep(200);

}// try

catch (InterruptedException e){

e.printStackTrace();

}// catch

}// oneSec()

[1010 byte] By [bronze-starDukes] at [2007-11-26 12:13:24]
# 1
Thread.sleep(). It always applies to the current thread.I don't understand the rest of your question. You can't make a thread transient; you can't serialize a thread. Maybe your object should be Runnable instead of extending Thread?
platinumsta at 2007-7-7 14:14:41 > top of Java-index,Archived Forums,Socket Programming...