https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112021-02-09T23:13:39ZRuby Issue Tracking SystemRuby master - Bug #17505: Can `Thread#group` actually be `nil`?https://bugs.ruby-lang.org/issues/17505?journal_id=903132021-02-09T23:13:39Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I've added a pull request that fixes the documentation and removes code that deals with a missing thread group: <a href="https://github.com/ruby/ruby/pull/4163" class="external">https://github.com/ruby/ruby/pull/4163</a></p> Ruby master - Bug #17505: Can `Thread#group` actually be `nil`?https://bugs.ruby-lang.org/issues/17505?journal_id=903312021-02-10T15:56:12Zjeremyevans (Jeremy Evans)code@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Don't document that Thread#group can return nil Thread's are assigned a group at initialization,..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/fc83b4896e9d7de084b203b133b84c1209c6ad88">git|fc83b4896e9d7de084b203b133b84c1209c6ad88</a>.</p>
<hr>
<p>Don't document that Thread#group can return nil</p>
<p>Thread's are assigned a group at initialization, and no API exists<br>
for them to unassign them from a group without assigning them to<br>
another group.</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Can `Thread#group` actually be `nil`? (Closed)" href="https://bugs.ruby-lang.org/issues/17505">#17505</a>]</p> Ruby master - Bug #17505: Can `Thread#group` actually be `nil`?https://bugs.ruby-lang.org/issues/17505?journal_id=903472021-02-11T14:39:37Zznz (Kazuhiro NISHIYAMA)
<ul></ul><p>Just FYI</p>
<p>Japanese documents says</p>
<pre><code>死んでいるスレッドは nil を返します。
</code></pre>
<p>Dead thread's group returns <code>nil</code> from 1.8.0 to 1.9.0-0.</p>
<pre><code>% docker run -it --rm ghcr.io/ruby/all-ruby env ALL_RUBY_SINCE=ruby-1.8 ./all-ruby -e 'th=Thread.start{};Thread.pass;p th.group.class'
ruby-1.8.0 NilClass
...
ruby-1.9.0-0 NilClass
ruby-1.9.0-1 ThreadGroup
...
ruby-3.0.0 ThreadGroup
</code></pre> Ruby master - Bug #17505: Can `Thread#group` actually be `nil`?https://bugs.ruby-lang.org/issues/17505?journal_id=903492021-02-11T15:34:02Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul></ul><p>Perfect, so this confirms the spec has changed a long time ago 👍</p>