i am making a project in which i ahve shedule somthing happen after a certain period of time,
i calculate that time an pass that time in sleep method.
if i again changes the time then i want to end previous thread and start a new thread.
so i want to know how to end the thread which is in sleep method without executing it’s run method.
i am making a project in which i ahve shedule somthing happen after a
Share
I assume Java when you are programing for Blackberry?
If yes, don’t use
Thread.sleep()to wait, but insteadwait()on a monitor, which you can thennotifyAll(), i.e.The
synchronizedblocks are important, as you need to own the monitor you want to wait on or notify on.