This commit is contained in:
jfrijters 2006-09-25 05:52:16 +00:00
Родитель abeedd5863
Коммит ed2d8c5e90
2 изменённых файлов: 10 добавлений и 14 удалений

Просмотреть файл

@ -77,6 +77,7 @@ public final class SelectorImpl extends AbstractSelector implements VMThread.Int
protected void implCloseSelector() throws IOException
{
// note that notifySocket gets closed by wakeup
wakeup();
}
@ -186,12 +187,12 @@ public final class SelectorImpl extends AbstractSelector implements VMThread.Int
unhandledWakeup = false;
return 0;
}
else
if (notifySocket == null)
{
notifySocket = createNotifySocket();
}
}
read.Add(notifySocket);
}
try
{
@ -225,13 +226,8 @@ public final class SelectorImpl extends AbstractSelector implements VMThread.Int
&& !unhandledWakeup);
}
finally
{
synchronized (wakeupMutex)
{
unhandledWakeup = false;
notifySocket.Close();
notifySocket = null;
}
}
int updatedCount = 0;
@ -353,6 +349,7 @@ public final class SelectorImpl extends AbstractSelector implements VMThread.Int
if (notifySocket != null)
{
notifySocket.Close();
notifySocket = null;
}
}
return this;

Просмотреть файл

@ -139,9 +139,9 @@ public final class SocketChannelImpl extends SocketChannel implements VMThread.I
{
implConnect(connectAddress.getAddress(), connectAddress.getPort());
state = CONNECTED;
if (isBlocking())
synchronized (blockingLock())
{
impl.setBlocking(true);
impl.setBlocking(isBlocking());
}
}
finally
@ -246,16 +246,15 @@ public final class SocketChannelImpl extends SocketChannel implements VMThread.I
if (state != CONNECTION_PENDING)
throw new NoConnectionPendingException();
if (isBlocking() || connectionPendingReady || impl.isConnectFinished())
{
try
{
implEndConnect();
state = CONNECTED;
if (isBlocking())
synchronized (blockingLock())
{
impl.setBlocking(true);
impl.setBlocking(isBlocking());
}
}
finally