harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r592915 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c
Date Wed, 07 Nov 2007 21:43:59 GMT
Author: hindessm
Date: Wed Nov  7 13:43:59 2007
New Revision: 592915

URL: http://svn.apache.org/viewvc?rev=592915&view=rev
Log:
Minor fix for Aix and z/OS - sleepFor seems like a bit of a hack to me.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c?rev=592915&r1=592914&r2=592915&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/procimpl.c Wed
Nov  7 13:43:59 2007
@@ -39,6 +39,14 @@
 void
 sleepFor (unsigned int nanoseconds)
 {
+
+#if defined(AIX) || defined(ZOS)
+/* These platforms don't have nanosleep(). */
+
+	unsigned int microseconds = (nanoseconds+999) / 1000;
+	usleep(microseconds);
+
+#else /* other unix platforms */
   struct timespec delay, remDelay;
   delay.tv_sec = 0;
   delay.tv_nsec = nanoseconds;
@@ -54,6 +62,7 @@
           break;    /* Oops the sleep didn't work ??? */
         }
     }
+#endif /* AIX or ZOS */
 }
 
 int



Mime
View raw message