aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>2004-02-29 11:13:45 -0800
committerPer Bothner <bothner@gcc.gnu.org>2004-02-29 11:13:45 -0800
commit3ae1e52c9197131a764d47f4b09fc44a91db3558 (patch)
treee2ce6d960e94e9c575376f13015a2a7aec40ac74
parentd199feb74801bcbcf2306ae4f40866814f1099dc (diff)
downloadgcc-3ae1e52c9197131a764d47f4b09fc44a91db3558.zip
gcc-3ae1e52c9197131a764d47f4b09fc44a91db3558.tar.gz
gcc-3ae1e52c9197131a764d47f4b09fc44a91db3558.tar.bz2
FileLockImpl.java (fd): Remove field, replacing it by:
* 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. From-SVN: r78663
-rw-r--r--libjava/gnu/java/nio/FileLockImpl.java14
-rw-r--r--libjava/gnu/java/nio/natFileLockImpl.cc24
2 files changed, 6 insertions, 32 deletions
diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java
index eff3320..23f67b8 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());
}
}
diff --git a/libjava/gnu/java/nio/natFileLockImpl.cc b/libjava/gnu/java/nio/natFileLockImpl.cc
deleted file mode 100644
index d3d01a1..0000000
--- a/libjava/gnu/java/nio/natFileLockImpl.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// natFileLockImpl.cc
-
-/* Copyright (C) 2003 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-
-#include <jvm.h>
-#include <errno.h>
-
-#include <gnu/java/nio/FileLockImpl.h>
-#include <java/io/FileDescriptor.h>
-#include <java/io/IOException.h>
-
-void
-gnu::java::nio::FileLockImpl::releaseImpl ()
-{
- fd->unlock(position(), size());
-}