< prev index next >

src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java

Print this page
rev 8219 : 8024900: PPC64: Enable new build on AIX (jdk part)
8024854: PPC64: Basic changes and files to build the class library on AIX
Reviewed-by: alanb, prr, sla, chegar, michaelm, mullan, art, erikj
Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, thomas.stuefe@sap.com


 185     public AsynchronousFileChannel truncate(long size) throws IOException {
 186         if (size < 0)
 187             throw new IllegalArgumentException("Negative size");
 188         if (!writing)
 189             throw new NonWritableChannelException();
 190         try {
 191             begin();
 192             if (size > nd.size(fdObj))
 193                 return this;
 194             nd.truncate(fdObj, size);
 195         } finally {
 196             end();
 197         }
 198         return this;
 199     }
 200 
 201     @Override
 202     public void force(boolean metaData) throws IOException {
 203         try {
 204             begin();
 205             nd.force(fdObj, metaData);

 206         } finally {
 207             end();
 208         }
 209     }
 210 
 211     // -- file locking --
 212 
 213     /**
 214      * Task that initiates locking operation and handles completion result.
 215      */
 216     private class LockTask<A> implements Runnable, Iocp.ResultHandler {
 217         private final long position;
 218         private final FileLockImpl fli;
 219         private final PendingFuture<FileLock,A> result;
 220 
 221         LockTask(long position,
 222                  FileLockImpl fli,
 223                  PendingFuture<FileLock,A> result)
 224         {
 225             this.position = position;




 185     public AsynchronousFileChannel truncate(long size) throws IOException {
 186         if (size < 0)
 187             throw new IllegalArgumentException("Negative size");
 188         if (!writing)
 189             throw new NonWritableChannelException();
 190         try {
 191             begin();
 192             if (size > nd.size(fdObj))
 193                 return this;
 194             nd.truncate(fdObj, size);
 195         } finally {
 196             end();
 197         }
 198         return this;
 199     }
 200 
 201     @Override
 202     public void force(boolean metaData) throws IOException {
 203         try {
 204             begin();
 205             //  Added parameter writable for AIX platform port (not used on Windows).
 206             nd.force(fdObj, metaData, writing);
 207         } finally {
 208             end();
 209         }
 210     }
 211 
 212     // -- file locking --
 213 
 214     /**
 215      * Task that initiates locking operation and handles completion result.
 216      */
 217     private class LockTask<A> implements Runnable, Iocp.ResultHandler {
 218         private final long position;
 219         private final FileLockImpl fli;
 220         private final PendingFuture<FileLock,A> result;
 221 
 222         LockTask(long position,
 223                  FileLockImpl fli,
 224                  PendingFuture<FileLock,A> result)
 225         {
 226             this.position = position;


< prev index next >