bugGuile - Bugs: bug #27634, sleep does not work under windows...


bug #27634: sleep does not work under windows mingw

Submitted by:  Scott McPeak <smcpeak>
Submitted on:  Fri 09 Oct 2009 01:29:47 AM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 09 Oct 2009 01:29:47 AM UTC, original submission:  

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.

Scott McPeak <smcpeak>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #18834:  windows-sleep-fix.diff added by smcpeak (910B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by smcpeak (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-10-09 smcpeak Attached File- => Added windows-sleep-fix.diff, #18834

    Back to the top

    Powered by Savane 3.5