summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/nio/FileLockImpl.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-14 06:37:59 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-14 06:37:59 +0000
commit87a1da8d641b8769b808ab2e806027e237261a23 (patch)
tree24fccf7ef3db6564bf6419c09974cfbc9fba0c84 /libjava/gnu/java/nio/FileLockImpl.java
parent979e2687de7fcb92a1b39364206d02cda2f1dd25 (diff)
downloadppe42-gcc-87a1da8d641b8769b808ab2e806027e237261a23.tar.gz
ppe42-gcc-87a1da8d641b8769b808ab2e806027e237261a23.zip
2003-05-14 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileLockImpl.java (released): New member variable. (FileLockImpl): Initialize released. (releaseImpl): New native method. (release): Implemented. * gnu/java/nio/SelectorImpl.java: Reformatted. * gnu/java/nio/SelectionKeyImpl.java: Reformatted. * gnu/java/nio/ServerSocketChannelImpl.java: Reformatted. (accept): Throws IOException. * gnu/java/nio/SocketChannelImpl.java: Reformatted. (implConfigureBlocking): Throws IOException. (connect): Likewise. (read): Likewise. (write): Likewise. * gnu/java/nio/natFileLockImpl.cc: New file. * java/nio/channels/FileLock.java: Reformatted. * Makefile.am: (ordinary_java_source_files): Added gnu/java/nio/FileLockImpl.java. (nat_source_files): Added gnu/java/nio/natFileLockImpl.cc. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66799 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/nio/FileLockImpl.java')
-rw-r--r--libjava/gnu/java/nio/FileLockImpl.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java
index 2e55f6bb657..088e552bea2 100644
--- a/libjava/gnu/java/nio/FileLockImpl.java
+++ b/libjava/gnu/java/nio/FileLockImpl.java
@@ -35,29 +35,41 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
+import java.io.FileDescriptor;
+import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
/**
* @author Michael Koch
+ * @since 1.4
*/
public class FileLockImpl extends FileLock
{
- public FileLockImpl (FileChannel channel, long position, long size,
- boolean shared)
+ private FileDescriptor fd;
+ private boolean released;
+
+ public FileLockImpl (FileDescriptor fd, FileChannel channel, long position,
+ long size, boolean shared)
{
super (channel, position, size, shared);
+ this.fd = fd;
+ this.released = false;
}
public boolean isValid ()
{
- throw new Error ("Not implemented");
+ return (released || !channel.isOpen ());
}
- public void release ()
+ private native void releaseImpl () throws IOException;
+
+ public synchronized void release () throws IOException
{
- throw new Error ("Not implemented");
+ releaseImpl ();
+ released = true;
}
}
OpenPOWER on IntegriCloud