Last active
August 29, 2015 14:01
-
-
Save pdeva/0c98a29d92ed38e0d20c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
{ | |
private boolean stop; | |
//called by thread 1 | |
public void run() | |
{ | |
while(!stop) | |
{ | |
//do something | |
} | |
} | |
//called by thread 2 | |
public void doStop() | |
{ | |
stop=true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment