diff options
| author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-29 19:13:45 +0000 |
|---|---|---|
| committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-29 19:13:45 +0000 |
| commit | b2468e06703f481bfd0739d1b0f4392cf4653cd5 (patch) | |
| tree | e2ce6d960e94e9c575376f13015a2a7aec40ac74 /libjava/gnu/java/nio/FileLockImpl.java | |
| parent | b4be9bd25f9728e4ca31b1df051ecdb2032d13eb (diff) | |
| download | gcc-b2468e06703f481bfd0739d1b0f4392cf4653cd5.tar.gz | |
* gnu/java/nio/FileLockImpl.java (fd): Remove field, replacing it by:
(ch): New FileChannelImpl field. Update constructor to match.
(releaseImpl): Remove native method. Instead ...
(release): Call unlock on channel.
* gnu/java/nio/natFileLockImpl.cc: Removed file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78663 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/nio/FileLockImpl.java')
| -rw-r--r-- | libjava/gnu/java/nio/FileLockImpl.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java index eff3320770f..23f67b8ded2 100644 --- a/libjava/gnu/java/nio/FileLockImpl.java +++ b/libjava/gnu/java/nio/FileLockImpl.java @@ -40,9 +40,9 @@ package gnu.java.nio; import java.io.FileDescriptor; import java.io.IOException; -import java.nio.channels.FileChannel; -import java.nio.channels.FileLock; +import java.nio.channels.*; import gnu.classpath.Configuration; +import gnu.java.nio.channels.FileChannelImpl; /** * @author Michael Koch @@ -59,13 +59,13 @@ public class FileLockImpl extends FileLock } } - private FileDescriptor fd; + private FileChannelImpl ch; - public FileLockImpl (FileDescriptor fd, FileChannel channel, long position, + public FileLockImpl (FileChannelImpl channel, long position, long size, boolean shared) { super (channel, position, size, shared); - this.fd = fd; + ch = channel; } protected void finalize() @@ -85,10 +85,8 @@ public class FileLockImpl extends FileLock return !channel().isOpen(); } - private native void releaseImpl () throws IOException; - public synchronized void release () throws IOException { - releaseImpl (); + ch.unlock(position(), size()); } } |
