This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: posix-threads code update


Tom Tromey wrote:

> How about changing the Windows _Jv_CondWait to return the correct
> _JV_* values at least?  Currently it returns error codes, which isn't
> right.

OK.

Index: win32-threads.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/win32-threads.cc,v
retrieving revision 1.1
diff -u -r1.1 win32-threads.cc
--- win32-threads.cc	2000/03/15 22:03:19	1.1
+++ win32-threads.cc	2000/03/28 01:18:43
@@ -69,6 +69,8 @@
   DWORD time;
   DWORD rval;
 
+  // FIXME: check for mutex ownership?
+
   _Jv_MutexUnlock (mu);
 
   if((millis == 0) && (nanos > 0))
@@ -82,9 +84,7 @@
   _Jv_MutexLock (mu);
 
   if (rval == WAIT_FAILED)
-    return GetLastError ();       // FIXME: Map to errno?
-  else if (rval == WAIT_TIMEOUT)
-    return ETIMEDOUT;
+    return _JV_NOT_OWNER;       // FIXME?
   else
     return 0;
 }
Index: include/win32-threads.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/win32-threads.h,v
retrieving revision 1.1
diff -u -r1.1 win32-threads.h
--- win32-threads.h	2000/03/15 22:03:19	1.1
+++ win32-threads.h	2000/03/28 01:18:43
@@ -54,13 +54,15 @@
 inline int
 _Jv_CondNotify (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *)
 {
-  return PulseEvent (*cv) ? 0 : GetLastError ();        // FIXME: Map error code?
+  // FIXME: check for mutex ownership?
+  return PulseEvent (*cv) ? 0 : _JV_NOT_OWNER;        // FIXME?
 }
 
 inline int
 _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *)
 {
-  return PulseEvent (*cv) ? 0 : GetLastError ();        // FIXME: Map error code?
+  // FIXME: check for mutex ownership?
+  return PulseEvent (*cv) ? 0 : _JV_NOT_OWNER;        // FIXME?
 }
 
 //

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]