SE450: Sensing Interruptions [16/36] Previous pageContentsNext page

public class MyRunnable implements Runnable
{
public void run()
{
try
{
while (...)
{
do work
Thread.sleep(...);
}
}
catch (InterruptedException e) {}
clean up
}
}

Previous pageContentsNext page