Project

General

Profile

Actions

Bug #17146

open

Queue operations are allowed after it is frozen

Added by Eregon (Benoit Daloze) almost 2 years ago. Updated 8 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
[ruby-core:99903]

Description

[1] pry(main)> q = Queue.new
=> #<Thread::Queue:0x000056263683aee8>
[2] pry(main)> q.freeze
=> #<Thread::Queue:0x000056263683aee8>
[3] pry(main)> q << 1
=> #<Thread::Queue:0x000056263683aee8>
[4] pry(main)> q.pop
=> 1
[5] pry(main)> q.frozen?
=> true

Found by @ko1 (Koichi Sasada) in https://bugs.ruby-lang.org/issues/17100#note-28

I think it's a bug, since those are clear mutations.
I guess old Thread::Queue implemented in Ruby did not have this bug.

Actions

Also available in: Atom PDF