unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Beswick <dlbeswick@gmail.com>
Cc: 29704-done@debbugs.gnu.org
Subject: bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts
Date: Fri, 16 Feb 2018 15:31:02 +0100	[thread overview]
Message-ID: <87h8qhnh09.fsf@gnu.org> (raw)
In-Reply-To: <47bd4b8a-55fe-bc92-4a64-b8bdeba2e5d5@gmail.com> (David Beswick's message of "Thu, 14 Dec 2017 12:37:41 +1100")

Hi David,

David Beswick <dlbeswick@gmail.com> skribis:

> I would expect the following command to return in 5 seconds:
> $ guile -c '(use-modules (srfi srfi-18)) (let ((cv
> (make-condition-variable)) (m (make-mutex))) (mutex-lock! m)
> (mutex-unlock! m cv 5))'
>
> However, it returns instantly for me. This command works as expected:
> $ guile -c "(use-modules ((srfi srfi-18) #:prefix srfi:)) (let ((cv
> (srfi:make-condition-variable)) (m (srfi:make-mutex)))
> (srfi:mutex-lock! m) (srfi:mutex-unlock! m cv (+ (current-time) 5)))"
>
>
> It's stated on the page https://srfi.schemers.org/srfi-18/srfi-18.html that:
>
> "All synchronization primitives which take a timeout parameter accept three
> types of values as a timeout, with the following meaning:
>
> * a time object represents an absolute point in time
>
> * an exact or inexact real number represents a relative time in
> seconds from the
>   moment the primitive was called
>
> * #f means that there is no timeout"
>
> Assuming this page is accurate, then the case in the test code
> falls under the second dot point from the spec.

Sorry the late reply.  I believe this and a similar issue with
‘thread-sleep!’ is now fixed:

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=2c7b350f93564daee16a311c001a85577d4b69e1
  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=39860539599f74958c0cc9008fc6fa271349b58b

Let me know if anything’s wrong!

Thank you,
Ludo’.





      reply	other threads:[~2018-02-16 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  1:37 bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts David Beswick
2018-02-16 14:31 ` Ludovic Courtès [this message]

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=87h8qhnh09.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=29704-done@debbugs.gnu.org \
    --cc=dlbeswick@gmail.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).