Checked in Matt Welsh's patch

Tom Tromey tromey@cygnus.com
Tue Sep 7 19:31:00 GMT 1999


>>>>> "Matt" == Matt Welsh <mdw@cs.berkeley.edu> writes:

Matt> Actually, your change to check "if (r && errno == EINTR)" is not
Matt> correct.

Thanks.  This was a systematic error I was making; my old code had the
problem too.

Here is what I'm checking in:

1999-09-07  Tom Tromey  <tromey@cygnus.com>

	* posix-threads.cc (_Jv_CondWait): pthread_ calls return error
	code and don't set errno.

Tom

Index: posix-threads.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/posix-threads.cc,v
retrieving revision 1.8
diff -u -r1.8 posix-threads.cc
--- posix-threads.cc	1999/09/08 00:43:05	1.8
+++ posix-threads.cc	1999/09/08 02:27:54
@@ -104,7 +104,7 @@
 
 	  r = pthread_cond_timedwait (cv, pmu, &ts);
 
-	  if (r && errno == EINTR)
+	  if (r == EINTR)
 	    {
 	      /* We were interrupted by a signal.  Either this is
 		 because we were interrupted intentionally (i.e. by
@@ -127,7 +127,7 @@
 		    }
 		}
 	    }
-	  else if (r && errno == ETIMEDOUT)
+	  else if (r == ETIMEDOUT)
 	    {
 	      /* A timeout is a normal result.  */
 	      r = 0;
@@ -139,7 +139,7 @@
       while (! done_sleeping);
     }
 
-  return r;
+  return r != 0;
 }
 
 #ifndef RECURSIVE_MUTEX_IS_DEFAULT


More information about the Java-patches mailing list