• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CLDC1.0 cannot interrupt Thread

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I hallucinating or is it true that I cannot interrupt a Thread in CLDC1.0 ?
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not seeing things - there is no interrupt() method in CLDC 1.0. It was reintroduced in 1.1.
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Theodore
 
Michael Charland
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the question has been answer but I found this is J2ME in a Nutshell on page 27.

"� The destroy( ), interrupt( ), and isInterrupted( ) methods do not exist.
Consequently, the only way to cause a thread to terminate is to signal it to do so by changing the value of an instance variable that the thread periodically inspects, using a construction like the following:
public void run( ) {
while (!requestedToStop) {
// Do whatever is required
}
}
"

I love it. A while loop.
[ August 09, 2006: Message edited by: Michael Charland ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic