Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Thread::{Queue,SizedQueue}#freeze raise TypeError #3730

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Compatibility:
* Support serializing of `Data` instances into Marshal format (#3726, @andrykonchin).
* `Array#pack` now raises `ArgumentError` for unknown directives (#3681, @Th3-M4jor).
* `String#unpack` now raises `ArgumentError` for unknown directives (#3681, @Th3-M4jor).
* `Thread::Queue#freeze` now raises `TypeError` when called (#3681, @Th3-M4jor).
* `Thread::SizedQueue#freeze` now raises `TypeError` when called (#3681, @Th3-M4jor).

Performance:

Expand Down
8 changes: 8 additions & 0 deletions lib/truffle/thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def pop(non_block = false, timeout: nil)
end
alias_method :shift, :pop
alias_method :deq, :pop

def freeze
raise TypeError, "cannot freeze #{self}"
end
end

class SizedQueue
Expand All @@ -62,5 +66,9 @@ def push(value, non_block = false, timeout: nil)
end
alias_method :<<, :push
alias_method :enq, :push

def freeze
raise TypeError, "cannot freeze #{self}"
end
end
end
1 change: 0 additions & 1 deletion spec/tags/core/queue/freeze_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/sizedqueue/freeze_tags.txt

This file was deleted.

Loading