From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Beswick Newsgroups: gmane.lisp.guile.bugs Subject: bug#29704: Guile 2.2.2: SRFI-18, condition variables, timeouts Date: Thu, 14 Dec 2017 12:37:41 +1100 Message-ID: <47bd4b8a-55fe-bc92-4a64-b8bdeba2e5d5@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1513218793 10782 195.159.176.226 (14 Dec 2017 02:33:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Dec 2017 02:33:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: 29704@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Dec 14 03:33:06 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePJKb-0002Oi-KG for guile-bugs@m.gmane.org; Thu, 14 Dec 2017 03:33:05 +0100 Original-Received: from localhost ([::1]:38842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePJKi-0008AH-Jb for guile-bugs@m.gmane.org; Wed, 13 Dec 2017 21:33:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePJKc-00089z-9I for bug-guile@gnu.org; Wed, 13 Dec 2017 21:33:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePJKY-0002I3-9o for bug-guile@gnu.org; Wed, 13 Dec 2017 21:33:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePJKY-0002Hm-6E for bug-guile@gnu.org; Wed, 13 Dec 2017 21:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePJKY-0001bE-0g for bug-guile@gnu.org; Wed, 13 Dec 2017 21:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Beswick Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 14 Dec 2017 02:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29704 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15132187766132 (code B ref -1); Thu, 14 Dec 2017 02:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Dec 2017 02:32:56 +0000 Original-Received: from localhost ([127.0.0.1]:32847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePJKR-0001ao-77 for submit@debbugs.gnu.org; Wed, 13 Dec 2017 21:32:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePITJ-00005d-Ar for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:38:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePITD-0006zf-27 for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:37:56 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePITC-0006zT-Uv for submit@debbugs.gnu.org; Wed, 13 Dec 2017 20:37:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePITB-00037e-LV for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePIT6-0006vR-OZ for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:53 -0500 Original-Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:34478) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePIT6-0006uh-IE for bug-guile@gnu.org; Wed, 13 Dec 2017 20:37:48 -0500 Original-Received: by mail-pg0-x22f.google.com with SMTP id j4so2375661pgp.1 for ; Wed, 13 Dec 2017 17:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=nscPnkC/Om48b7OOVSkQIH6QSECicgD7poegtQIEnP0=; b=CNkDFW0l3d7TmRmAoAuQvbK2d0B2CqMJZBcA6xA87BnYzGYSvLGqhM4zYV5UABIA2n RDr5Wd7E3G5xf8mIpvizDY9lt7Qvox/VnhjybHEmHfZ2Tn/Hc5RnSuAXyx4M6kcM34x3 EhmntNzTC5bTgver2UdbBVNs/vfgvnIG349XUKlH8ETrKUrV3moHJ56uFtHQ8QPzTmYU A2uQhq6FK/ysdZJScuvRYFHwrwj6VzeEog2xnabY403yaZZeea4fCgd2reMZpCmqMa5L YhBsI997JKPwKpOmr1VvTsUfSwfMjftN/0cULLECQUHEHs3bbL+u34JcW/R2plMiL0zj 3evA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=nscPnkC/Om48b7OOVSkQIH6QSECicgD7poegtQIEnP0=; b=ROmNt8JwB3pJYeCYm1tUjrVkDuajBlbMgDnaj3RFYngV717gPW3QvmWsHckBNUcV7b gOZ/tDA4Dmyx1CqsFV6cVqJoNcEJH5/LaB4lli2HVm5uyZP7Mlwa1LBMQz1tAtz7BdKx +d7OOKoFqrIea5wB4g9rugfA7vLALkU71raw+M+9Btdsn384o+wsnDBlC/Q7gbDhb3os VZHa5jFz+mDEgA9f9i/IPPZAJT4yLPMKWkx/LT5TLHq+s8dPJ0nfACtnbcYoOHy3LBTr dV7H1o21sgnTROiLgH8cFs44wrDUvczU411Eemr4ZjUUkXx6yvR1ZJUA9amXQ9758QUV lW9g== X-Gm-Message-State: AKGB3mKzXosvYzZAjJQX64uQv+WUDqI2FwSWbgKXDF+jyuXSWzNPT3C/ Erwj0OBOQo7dctCs9wNN7TofTg== X-Google-Smtp-Source: ACJfBos9sGDWHcDCXOpTxqGal6/dhEkxwEipJZ+NBolzWdOfbosRE17Ls4xv61cvNUfGbBU8yE1I8w== X-Received: by 10.101.93.79 with SMTP id e15mr6921237pgt.157.1513215466815; Wed, 13 Dec 2017 17:37:46 -0800 (PST) Original-Received: from [192.168.178.61] ([203.217.89.47]) by smtp.googlemail.com with ESMTPSA id t1sm4818920pgs.13.2017.12.13.17.37.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 17:37:45 -0800 (PST) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 13 Dec 2017 21:32:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8930 Archived-At: Hello, I'm using Guile 2.2.2 built from source as downloaded from the project website. $ guile -v guile (GNU Guile) 2.2.2 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. The source in module/srfi/srfi-18.scm seems to pass the timeout parameter unaltered to Guile's wait-condition-variable function, and that parameter is said in the docs to be "either a integer as returned by ‘current-time’ or a pair as returned by ‘gettimeofday’". I think that would cause the unexpected behaviour that I see. I have some time at the moment where I could address this, please let me know if you would like me to work on a fix. Regards, David