unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Scott McPeak <INVALID.NOREPLY@gnu.org>
To: Scott McPeak <smcpeak@coverity.com>, bug-guile@gnu.org
Subject: [bug #27634] sleep does not work under windows mingw
Date: Fri, 09 Oct 2009 01:29:48 +0000	[thread overview]
Message-ID: <20091009-012947.sv54812.37501@savannah.gnu.org> (raw)
In-Reply-To: 


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/





                 reply	other threads:[~2009-10-09  1:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091009-012947.sv54812.37501@savannah.gnu.org \
    --to=invalid.noreply@gnu.org \
    --cc=bug-guile@gnu.org \
    --cc=smcpeak@coverity.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).