/[classpath]/classpath/gnu/java/nio/FileLockImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/FileLockImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mkoch, Tue Mar 11 12:09:35 2003 UTC revision 1.2 by mkoch, Tue May 20 10:38:48 2003 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package gnu.java.nio;  package gnu.java.nio;
40    
41    import java.io.FileDescriptor;
42    import java.io.IOException;
43  import java.nio.channels.FileChannel;  import java.nio.channels.FileChannel;
44  import java.nio.channels.FileLock;  import java.nio.channels.FileLock;
45    
46  /**  /**
47   * @author Michael Koch   * @author Michael Koch
48     * @since 1.4
49   */   */
50  public class FileLockImpl extends FileLock  public class FileLockImpl extends FileLock
51  {  {
52    public FileLockImpl (FileChannel channel, long position, long size,    private FileDescriptor fd;
53                         boolean shared)    private boolean released;
54      
55      public FileLockImpl (FileDescriptor fd, FileChannel channel, long position,
56                           long size, boolean shared)
57    {    {
58      super (channel, position, size, shared);      super (channel, position, size, shared);
59        this.fd = fd;
60        this.released = false;
61    }    }
62        
63    public boolean isValid ()    public boolean isValid ()
64    {    {
65      throw new Error ("Not implemented");      return (released
66                || !channel ().isOpen ());
67    }    }
68    
69    public void release ()    private native void releaseImpl () throws IOException;
70    
71      public synchronized void release () throws IOException
72    {    {
73      throw new Error ("Not implemented");      releaseImpl ();
74        released = true;
75    }    }
76  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26