unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #27634] sleep does not work under windows mingw
@ 2009-10-09  1:29 Scott McPeak
  0 siblings, 0 replies; only message in thread
From: Scott McPeak @ 2009-10-09  1:29 UTC (permalink / raw)
  To: Scott McPeak, bug-guile


URL:
  <http://savannah.gnu.org/bugs/?27634>

                 Summary: sleep does not work under windows mingw
                 Project: Guile
            Submitted by: smcpeak
            Submitted on: Fri 09 Oct 2009 01:29:47 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The implementation of sleep/usleep in Guile-1.8.7 uses select(), but that
doesn't work on Windows using mingw:

guile> (sleep 1)
1                    ; returned immediately
guile> (sleep 4)
4                    ; returned immediately

On unix and on Windows under cygwin, these calls actually sleep, and return 0
normally.

Note: The select implementation on unix seems to rely on the "sleep pipe".  I
submitted a bug report including a patch that removes that pipe on mingw (bug
27573), but sleep doesn't work even with the pipe enabled.

The fix is straightforward, making 'sleep' and 'usleep' call 'Sleep' rather
than 'select'.  I assume that's how it was at some point in the past because
scmsigs.c has definitions of 'sleep' and 'usleep' at the top of the file that
are not currently used.

Suggested patch attached.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 09 Oct 2009 01:29:47 AM GMT  Name: windows-sleep-fix.diff  Size:
910B   By: smcpeak

<http://savannah.gnu.org/bugs/download.php?file_id=18834>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27634>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-09  1:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09  1:29 [bug #27634] sleep does not work under windows mingw Scott McPeak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).