[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sleep on Windows systems
From: |
John W. Eaton |
Subject: |
Re: Sleep on Windows systems |
Date: |
Wed, 2 Oct 2002 22:19:39 -0500 |
On 2-Oct-2002, Paul Kienzle <address@hidden> wrote:
| We don't need to be that sophisticated since we are not event
| driven. Seems to me their code is wrong, too. As well as
| sleeping for the entire time, are they not also "sleeping"
| for the time required to process the event queue?
Yes, I suppose they assume it is only a small fraction of the total
time, but that may not always be valid.
Anyway, my point was just that they don't test for Sleep, they just
assume it is present on Windows systems. So that seems easier and not
as confusing as trying to make autoconf test for a mixed-case name.
How about the following change?
jwe
2002-10-02 John W. Eaton <address@hidden>
* cutils.c (octave_sleep): Handle Windows, which may not have
sleep, but should have Sleep.
Index: cutils.c
===================================================================
RCS file: /usr/local/cvsroot/octave/src/cutils.c,v
retrieving revision 1.8
diff -u -r1.8 cutils.c
--- cutils.c 26 Sep 2002 22:43:25 -0000 1.8
+++ cutils.c 3 Oct 2002 03:12:31 -0000
@@ -74,7 +74,11 @@
void
octave_sleep (unsigned int seconds)
{
+#if defined (__WIN32__) && ! defined (_POSIX_VERSION)
+ Sleep (1000 * seconds);
+#else
sleep (seconds);
+#endif
}
void