bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts


From: Ludovic Courtès
Subject: bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts
Date: Fri, 16 Feb 2018 15:31:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi David,

David Beswick <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]