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

 
 

bug #27634: sleep does not work under windows mingw

Submitter:  Scott McPeak <smcpeak>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.13-4448.
    Corresponding source code