Figure 3
Back to Article
Getting a thread to voluntarily stop execution.
Thread 1:
Thread 2:
thread2.stopRequested = true;
while (!stopRequested) {
// do a little work
}
Back to Article