harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r539776 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java
Date Sat, 19 May 2007 17:02:50 GMT
Author: ayza
Date: Sat May 19 10:02:49 2007
New Revision: 539776

URL: http://svn.apache.org/viewvc?view=rev&rev=539776
Log:
Applying patch for PipedInputStream from HARMONY-3347 ([classlib][io] ant exec.redirector
is unstable while works on HDK)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java?view=diff&rev=539776&r1=539775&r2=539776
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java
Sat May 19 10:02:49 2007
@@ -161,16 +161,15 @@
          */
         lastReader = Thread.currentThread();
         try {
-            boolean first = true;
+            int attempts = 3;
             while (in == -1) {
                 // Are we at end of stream?
                 if (isClosed) {
                     return -1;
                 }
-                if (!first && lastWriter != null && !lastWriter.isAlive())
{
+                if ((attempts-- <= 0) && lastWriter != null && !lastWriter.isAlive())
{
                     throw new IOException(Msg.getString("K0076")); //$NON-NLS-1$
                 }
-                first = false;
                 // Notify callers of receive()
                 notifyAll();
                 wait(1000);
@@ -243,16 +242,15 @@
          */
         lastReader = Thread.currentThread();
         try {
-            boolean first = true;
+            int attempts = 3;
             while (in == -1) {
                 // Are we at end of stream?
                 if (isClosed) {
                     return -1;
                 }
-                if (!first && lastWriter != null && !lastWriter.isAlive())
{
+                if ((attempts-- <= 0) && lastWriter != null && !lastWriter.isAlive())
{
                     throw new IOException(Msg.getString("K0076")); //$NON-NLS-1$
                 }
-                first = false;
                 // Notify callers of receive()
                 notifyAll();
                 wait(1000);



Mime
View raw message