In midp2.0, Thread.getState() is not usable. Then is there an alternative way to get the state of a thread? like blocked,live or dead.
Thanks
In midp2.0, Thread.getState() is not usable. Then is there an alternative way to get the state of a thread? like blocked,live or dead.
Thanks
Hello Zhang Jianliang,
based on: http://developers.sun.com/mobility/m...es/threading2/
"J2ME provides two variants of the Thread class, both subsets of the J2SE version 1.3. CLDC's Thread class includes only these methods:
activeCount()
currentThread()
getPriority()
isAlive()
join()
run()
setPriority()
sleep()
start()
yield()
..
Your code can obtain access to the current thread's instance of Thread at any time by invoking Thread.currentThread().
..
Once one thread has "asked" another thread to stop, the first thread can see whether the second is still alive by calling its isAlive() method. "
Regards,
r2j7
Hello r2j7:
"isAlive" includes two states: blocked and running.
Then how can i judge whether a thread is blocked in socket communication situation.
Thanks
Hi Zhang Jianliang,
In case if u r using notify(); on running thread then isAlive() will return false on this Thread object.
But its bit difficult to judge whether a thread is blocked in socket communication even I am also trying to find the solution.
All best
Anjan