From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 267F21F55B for ; Wed, 27 May 2020 23:05:22 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 22652120A88; Thu, 28 May 2020 08:04:51 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 88C09120A86 for ; Thu, 28 May 2020 08:04:49 +0900 (JST) Received: by filterdrecv-p3mdw1-6dbfd75bfd-hwfv9 with SMTP id filterdrecv-p3mdw1-6dbfd75bfd-hwfv9-18-5ECEF227-BF 2020-05-27 23:05:11.916122323 +0000 UTC m=+2258457.474804433 Received: from herokuapp.com (unknown) by ismtpd0006p1iad2.sendgrid.net (SG) with ESMTP id jpo3Q_vJSPys4apDlh69RQ for ; Wed, 27 May 2020 23:05:11.865 +0000 (UTC) Date: Wed, 27 May 2020 23:05:12 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 74344 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 16608 X-Redmine-Issue-Author: shugo X-Redmine-Issue-Assignee: nobu X-Redmine-Sender: jeremyevans0 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIGzPKFBFmjXwaSO54Iyc83s54vDhbDaWOKGQFL?= =?us-ascii?Q?tzN506ULibAfKaKspPUTApJFogDrO9qL+mv3aax?= =?us-ascii?Q?A7navGU+j204d=2Fo7WMTQX8xMcrJbdZ22XUWIkbU?= =?us-ascii?Q?u=2FDgEgL92nXAnIJcwpvYAcKfX1u4atw6+YySw0w?= =?us-ascii?Q?lubJgGVJobqy7726U=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 98552 Subject: [ruby-core:98552] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16608 has been updated by jeremyevans0 (Jeremy Evans). I agree with @Eregon that we can probably change the return value of ConditionVariable#wait in Ruby 3. As it always returns true currently, it's worthless and nothing should be relying on it. I can see that changing `Mutex#sleep` to start returning `nil` could break things, though. I think we do need a new method. Maybe `Mutex#sleep_for` or `Mutex#sleep!`. ---------------------------------------- Bug #16608: ConditionVariable#wait should return false when timeout exceeded https://bugs.ruby-lang.org/issues/16608#change-85845 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- The following program prints `false` on Ruby 1.8, but `true` on Ruby 1.9 or later. ``` require "monitor" m = Monitor.new c = m.new_cond m.synchronize { p c.wait(0.1) } ``` However, it's not critical because most programs check the condition after wait. -- https://bugs.ruby-lang.org/