Home How to break out of a LONG infinite loop
Reply: 0

How to break out of a LONG infinite loop

user7050
1#
user7050 Published in September 19, 2018, 7:16 pm

I searched but didn't find a solution. I have an infinite game loop running in a thread. It is very very long, so when I exit my app and use while(condition), it will keep going on respectively start another application in Android. How can I stop it? Must I check between EVERY method, if the thread got an interrupted-signal?

share|improve this question

closed as off-topic by Zyerah, Gabe Sechan, Raghav Sood, Emmanuel, Alex K Jan 9 '15 at 0:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Zyerah, Gabe Sechan, Raghav Sood, Emmanuel, Alex K
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 7
    I am really interested on an answer for this question, but for a short infinite loop. – Emmanuel Jan 8 '15 at 23:15
  • At the exit point, put System.exit(0). – Nathaniel D. Waggoner Jan 8 '15 at 23:21

1 Answer 1

active oldest votes
up vote 2 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.334228 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO