ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:102813] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded
Date: Wed, 10 Mar 2021 19:37:59 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-90865.20210310193758.12@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-16608.20200205091648.12@ruby-lang.org

Issue #16608 has been updated by jeremyevans0 (Jeremy Evans).


I've added a pull request that builds on @nobu's pull request, but uses a new method (`Mutex#sleep_for`) instead of making backwards-incompatible changes to `Mutex#sleep`: https://github.com/ruby/ruby/pull/4256

----------------------------------------
Bug #16608: ConditionVariable#wait should return false when timeout exceeded
https://bugs.ruby-lang.org/issues/16608#change-90865

* 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/

  parent reply	other threads:[~2021-03-10 19:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  9:16 [ruby-core:97063] [Ruby master Bug#16608] ConditionVariable#wait should return false when timeout exceeded shugo
2020-02-07  5:46 ` [ruby-core:97081] " shugo
2020-02-07  7:37 ` [ruby-core:97083] " shugo
2020-05-27 23:05 ` [ruby-core:98552] " merch-redmine
2021-03-10 19:37 ` merch-redmine [this message]
2021-03-18  0:06 ` [ruby-core:102910] " merch-redmine
2021-03-18 14:38 ` [ruby-core:102917] " eregontp
2021-04-16  8:51 ` [ruby-core:103479] " ko1
2021-06-16 16:46 ` [ruby-core:104312] " merch-redmine
2021-06-24 19:24 ` [ruby-core:104396] " merch-redmine

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-list from there: mbox

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

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

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

  git send-email \
    --in-reply-to=redmine.journal-90865.20210310193758.12@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /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).