From 18fe49590218acd408caabfe271da09f25cb2e68 Mon Sep 17 00:00:00 2001 From: marcandre Date: Sun, 16 Sep 2018 02:45:16 +0000 Subject: 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 --- thread_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'thread_sync.c') diff --git a/thread_sync.c b/thread_sync.c index 5244d9f3c9..b79db1fee3 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -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. * -- cgit v1.2.3