changeset 1085:267d1f8aa82a

6824135: (ch) test/java/nio/channels/AsyncCloseAndInterrupt.java fails (lnx) Reviewed-by: sherman
author alanb
date Thu, 02 Apr 2009 11:13:56 +0100
parents 85a91be56593
children 464727e3afb4
files src/share/classes/sun/nio/ch/FileChannelImpl.java test/java/nio/channels/AsyncCloseAndInterrupt.java
diffstat 2 files changed, 29 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/ch/FileChannelImpl.java	Tue Mar 31 23:52:04 2009 -0700
+++ b/src/share/classes/sun/nio/ch/FileChannelImpl.java	Thu Apr 02 11:13:56 2009 +0100
@@ -128,9 +128,10 @@
             throw new NonReadableChannelException();
         synchronized (positionLock) {
             int n = 0;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
@@ -151,9 +152,10 @@
             throw new NonReadableChannelException();
         synchronized (positionLock) {
             long n = 0;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
@@ -183,9 +185,10 @@
             throw new NonWritableChannelException();
         synchronized (positionLock) {
             int n = 0;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
@@ -206,9 +209,10 @@
             throw new NonWritableChannelException();
         synchronized (positionLock) {
             long n = 0;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
@@ -239,9 +243,10 @@
         ensureOpen();
         synchronized (positionLock) {
             long p = -1;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return 0;
                 do {
@@ -262,9 +267,10 @@
             throw new IllegalArgumentException();
         synchronized (positionLock) {
             long p = -1;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return null;
                 do {
@@ -283,9 +289,10 @@
         ensureOpen();
         synchronized (positionLock) {
             long s = -1;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return -1;
                 do {
@@ -311,9 +318,10 @@
         synchronized (positionLock) {
             int rv = -1;
             long p = -1;
-            int ti = threads.add();
+            int ti = -1;
             try {
                 begin();
+                ti = threads.add();
                 if (!isOpen())
                     return null;
 
@@ -350,9 +358,10 @@
     public void force(boolean metaData) throws IOException {
         ensureOpen();
         int rv = -1;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return;
             do {
@@ -406,9 +415,10 @@
             return IOStatus.UNSUPPORTED;
 
         long n = -1;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return -1;
             do {
@@ -612,9 +622,10 @@
             throw new NonReadableChannelException();
         ensureOpen();
         int n = 0;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return -1;
             do {
@@ -637,9 +648,10 @@
             throw new NonWritableChannelException();
         ensureOpen();
         int n = 0;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return -1;
             do {
@@ -731,9 +743,10 @@
             throw new NonReadableChannelException();
 
         long addr = -1;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return null;
             if (size() < position + size) { // Extend file size
@@ -900,9 +913,10 @@
         FileLockTable flt = fileLockTable();
         flt.add(fli);
         boolean i = true;
-        int ti = threads.add();
+        int ti = -1;
         try {
             begin();
+            ti = threads.add();
             if (!isOpen())
                 return null;
             int result = nd.lock(fd, true, position, size, shared);
--- a/test/java/nio/channels/AsyncCloseAndInterrupt.java	Tue Mar 31 23:52:04 2009 -0700
+++ b/test/java/nio/channels/AsyncCloseAndInterrupt.java	Thu Apr 02 11:13:56 2009 +0100
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4460583 4470470 4840199 6419424 6710579 6596323
+ * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135
  * @summary Comprehensive test of asynchronous closing and interruption
  * @author Mark Reinhold
  */