• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interrupting a Thread

 
Paulo Freitas
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can a Thread y interrupt a Thread x, if was x that has started Thread y?
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
X and Y are subclasses of Thread. An X object creates a Y object and starts the thread. The X object passes a reference to itself (a Thread object) to the Y object in the constructor.

X and Y implement Runnable. An X object creates a Y object. X passes a reference to the current thread in the constructor. X creates a Thread object and passes the Y object to the Thread object. X starts the thread.
 
Paulo Freitas
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Marlene. That was exactly what I wanted to know.
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And thank you Paulo for letting me know I answered the question you were asking.
 
bengt hammarlund
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marlene! I miss you!
Good news: I already got a job, and a good one. More details if you whant, email-me!
PS.: Paulo, are you from Brazil? I am Brazilian myself, and your name sound familiar.
 
Paulo Freitas
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right on the spot!!! I am brazilian(SP), but I have been living in Toronto/Canada for almost 2 years.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic