diff options
Diffstat (limited to 'libjava/java/io/FileInputStream.java')
-rw-r--r-- | libjava/java/io/FileInputStream.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java index 63390ec..533dd08 100644 --- a/libjava/java/io/FileInputStream.java +++ b/libjava/java/io/FileInputStream.java @@ -280,15 +280,12 @@ public class FileInputStream extends InputStream * A file channel must be created by first creating an instance of * Input/Output/RandomAccessFile and invoking the getChannel() method on it. */ - public FileChannel getChannel () + public synchronized FileChannel getChannel () { - synchronized (this) - { - if (ch == null) - ch = new FileChannelImpl (fd, false, this); + if (ch == null) + ch = new FileChannelImpl (fd, false, this); - return ch; - } + return ch; } } // class FileInputStream |