Use yield instead of sleep

This commit is contained in:
Trustin Lee 2010-01-25 13:09:31 +00:00
parent 6849ea2f4b
commit 7b6fb53fc1

View File

@ -71,21 +71,13 @@ public class NioServerSocketShutdownTimeTest {
((InetSocketAddress) channel.getLocalAddress()).getPort());
while (!handler.connected) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
// Ignore
}
Thread.yield();
}
socket.close();
while (!handler.closed) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
// Ignore
}
Thread.yield();
}
} finally {
if (socket != null) {