Thread.sleep() help, how does it decide which thread to sleep?
I've recently discovered (not really proud of it) that the sleep() method in the Thread class is a static method.
Knowing that fact now, the question I have is, how does this class decide which running thread to sleep?
I've used it before and it always seems to sleep the one i want, but how can i be sure if this is a static method and only the parameter of time is sent to it.
thanks in advance.
Re: Thread.sleep() help, how does it decide which thread to sleep?
Whatever Thread you execute the Thread.sleep() method in is the one that sleeps.