Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to stop execution

 
Happy S Singh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to stop the execution of the thread.I want to stop the execution while it is executing or on the button click event based on the thread id passed. I am trying below code


 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The key here is what happens in upload(). Setting the finished flag does not stop upload() from executing, it just prevents it from running again. If you want to make sure upload() stops before it completes there needs to be some way to interrupt the execution of that code. Since you don't show that code it is hard to say how you should do that.
 
Happy S Singh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My whole class with upload method.Guide me

 
Henry Wong
author
Marshal
Pie
Posts: 21212
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Happy S Singh wrote:
My whole class with upload method.Guide me



Steve gave you the answer -- and even a direction on making it do what you want.

Ignoring the answer, and dumping more code (that doesn't add to the topic) is not really very useful here.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic