mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add some missing documentation to Queue#{close|deq} [ci skip]
Patch by Lars Kanis. [Fix GH-1949] * Describe the impact of Queue#close to Queue#deq . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4452e857d4
commit
18fe495902
1 changed files with 3 additions and 1 deletions
|
@ -799,10 +799,12 @@ queue_do_push(VALUE self, struct rb_queue *q, VALUE obj)
|
|||
*
|
||||
* - +close+ will be ignored.
|
||||
*
|
||||
* - calling enq/push/<< will raise an exception.
|
||||
* - calling enq/push/<< will raise a +ClosedQueueError+.
|
||||
*
|
||||
* - when +empty?+ is false, calling deq/pop/shift will return an object
|
||||
* from the queue as usual.
|
||||
* - when +empty?+ is true, deq(false) will not suspend the thread and will return nil.
|
||||
* deq(true) will raise a +ThreadError+.
|
||||
*
|
||||
* ClosedQueueError is inherited from StopIteration, so that you can break loop block.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue