From 9719e37cec64c4a3e2b31c1141dbdd5979f6d69c Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 23 Jan 2004 14:37:09 +0000 Subject: FileLockImpl.java: Fixed filename in copyright. 2004-01-23 Michael Koch * gnu/java/nio/FileLockImpl.java: Fixed filename in copyright. (released): Removed. (finalize): New method. * gnu/java/nio/natFileLockImpl.cc (releaseImpl): Implemented. * java/nio/channels/FileChannelImpl.java: Reworked imports. (lock): Implemented. (lockImpl): New method. (tryLock): Implemented. (tryLockImpl): New method. * java/nio/channels/natFileChannelImpl.cc (lockImpl): New method. (tryLockImpl): New method. From-SVN: r76422 --- libjava/gnu/java/nio/FileLockImpl.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'libjava/gnu/java/nio/FileLockImpl.java') diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java index f85d60a..b621bd2 100644 --- a/libjava/gnu/java/nio/FileLockImpl.java +++ b/libjava/gnu/java/nio/FileLockImpl.java @@ -1,5 +1,5 @@ -/* FileChannelImpl.java -- - Copyright (C) 2002 Free Software Foundation, Inc. +/* FileLockImpl.java -- + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -60,14 +60,24 @@ public class FileLockImpl extends FileLock } 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 void finalize() + { + try + { + release(); + } + catch (IOException e) + { + // Ignore this. + } } public boolean isValid () -- cgit v1.1