summaryrefslogtreecommitdiffstats
path: root/libjava
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-07 16:51:49 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-07 16:51:49 +0000
commitff9976f53113d56bbf6b0ae85d5b6b34574cc251 (patch)
tree1a5cce4d1dcdf5ff059d56623bff738979decfdf /libjava
parent2f7bec9b1804e91dc7e0fb7628eb85b4416fb48f (diff)
downloadppe42-gcc-ff9976f53113d56bbf6b0ae85d5b6b34574cc251.tar.gz
ppe42-gcc-ff9976f53113d56bbf6b0ae85d5b6b34574cc251.zip
2004-01-07 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/DatagramChannelImpl.java (blocking): Removed. (DatagramChannelImpl): Call configureBlocking(). (implConfigureBlocking): Dont initialize blocking. * gnu/java/nio/ServerSocketChannelImpl.java (blocking): Removed. (ServerSocketChannelImpl): Call configureBlocking(). (implConfigureBlocking): Dont initialize blocking. * gnu/java/nio/SocketChannelImpl.java (blocking): Removed. (SocketChannelImpl): Call configureBlocking(). (implConfigureBlocking): Dont initialize blocking. (connect): Use isBlocking(). * java/nio/channels/spi/AbstractSelectableChannel.java (configureBlocking): Use blockingLock() instead of LOCK. Set blocking after successfully called implConfigureBlocking(). (register): Use blockingLock() instead of LOCK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog20
-rw-r--r--libjava/gnu/java/nio/DatagramChannelImpl.java3
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java3
-rw-r--r--libjava/gnu/java/nio/SocketChannelImpl.java5
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelectableChannel.java10
5 files changed, 29 insertions, 12 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c90c47efe23..85df30e65c6 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,25 @@
2004-01-07 Michael Koch <konqueror@gmx.de>
+ * gnu/java/nio/DatagramChannelImpl.java
+ (blocking): Removed.
+ (DatagramChannelImpl): Call configureBlocking().
+ (implConfigureBlocking): Dont initialize blocking.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (blocking): Removed.
+ (ServerSocketChannelImpl): Call configureBlocking().
+ (implConfigureBlocking): Dont initialize blocking.
+ * gnu/java/nio/SocketChannelImpl.java
+ (blocking): Removed.
+ (SocketChannelImpl): Call configureBlocking().
+ (implConfigureBlocking): Dont initialize blocking.
+ (connect): Use isBlocking().
+ * java/nio/channels/spi/AbstractSelectableChannel.java
+ (configureBlocking): Use blockingLock() instead of LOCK.
+ Set blocking after successfully called implConfigureBlocking().
+ (register): Use blockingLock() instead of LOCK.
+
+2004-01-07 Michael Koch <konqueror@gmx.de>
+
* java/net/ServerSocket.java (isBound): Fixed documentation.
2004-01-07 Sascha Brawer <brawer@dandelis.ch>
diff --git a/libjava/gnu/java/nio/DatagramChannelImpl.java b/libjava/gnu/java/nio/DatagramChannelImpl.java
index af43256cc28..3531803900a 100644
--- a/libjava/gnu/java/nio/DatagramChannelImpl.java
+++ b/libjava/gnu/java/nio/DatagramChannelImpl.java
@@ -56,13 +56,13 @@ import java.nio.channels.spi.SelectorProvider;
public final class DatagramChannelImpl extends DatagramChannel
{
private NIODatagramSocket socket;
- private boolean blocking = true;
protected DatagramChannelImpl (SelectorProvider provider)
throws IOException
{
super (provider);
socket = new NIODatagramSocket (new PlainDatagramSocketImpl(), this);
+ configureBlocking(true);
}
public int getNativeFD()
@@ -85,7 +85,6 @@ public final class DatagramChannelImpl extends DatagramChannel
throws IOException
{
socket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
- this.blocking = blocking;
}
public DatagramChannel connect (SocketAddress remote)
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index 97943c0ff8e..fd975d20a7a 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -55,7 +55,6 @@ import java.nio.channels.spi.SelectorProvider;
public final class ServerSocketChannelImpl extends ServerSocketChannel
{
private NIOServerSocket serverSocket;
- private boolean blocking = true;
private boolean connected;
protected ServerSocketChannelImpl (SelectorProvider provider)
@@ -63,6 +62,7 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel
{
super (provider);
serverSocket = new NIOServerSocket (this);
+ configureBlocking(true);
}
public int getNativeFD()
@@ -93,7 +93,6 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel
protected void implConfigureBlocking (boolean blocking) throws IOException
{
serverSocket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
- this.blocking = blocking;
}
public SocketChannel accept () throws IOException
diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java
index ced8ef2476a..efb5fec481b 100644
--- a/libjava/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/gnu/java/nio/SocketChannelImpl.java
@@ -65,7 +65,6 @@ public final class SocketChannelImpl extends SocketChannel
{
private PlainSocketImpl impl;
private NIOSocket socket;
- private boolean blocking = true;
private boolean connectionPending;
SocketChannelImpl (SelectorProvider provider)
@@ -74,6 +73,7 @@ public final class SocketChannelImpl extends SocketChannel
super (provider);
impl = new PlainSocketImpl();
socket = new NIOSocket (impl, this);
+ configureBlocking(true);
}
SocketChannelImpl (SelectorProvider provider,
@@ -117,7 +117,6 @@ public final class SocketChannelImpl extends SocketChannel
protected void implConfigureBlocking (boolean blocking) throws IOException
{
socket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
- this.blocking = blocking;
}
public boolean connect (SocketAddress remote) throws IOException
@@ -137,7 +136,7 @@ public final class SocketChannelImpl extends SocketChannel
if (((InetSocketAddress) remote).isUnresolved())
throw new UnresolvedAddressException();
- if (blocking)
+ if (isBlocking())
{
// Do blocking connect.
socket.connect (remote);
diff --git a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
index b027b034ede..17d6a2eaea1 100644
--- a/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/libjava/java/nio/channels/spi/AbstractSelectableChannel.java
@@ -75,13 +75,13 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
/**
* Adjusts this channel's blocking mode.
*/
- public final SelectableChannel configureBlocking (boolean block)
+ public final SelectableChannel configureBlocking (boolean blocking)
throws IOException
{
- synchronized (LOCK)
+ synchronized (blockingLock())
{
- blocking = true;
- implConfigureBlocking (block);
+ implConfigureBlocking(blocking);
+ this.blocking = blocking;
}
return this;
@@ -187,7 +187,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
SelectionKey key = null;
AbstractSelector selector = (AbstractSelector) selin;
- synchronized (LOCK)
+ synchronized (blockingLock())
{
key = locate (selector);
OpenPOWER on IntegriCloud