[前][次][番号順一覧][スレッド一覧]

ruby-changes:52544

From: marcandre <ko1@a...>
Date: Sun, 16 Sep 2018 11:45:20 +0900 (JST)
Subject: [ruby-changes:52544] marcandRe: r64756 (trunk): Add some missing documentation to Queue#{close|deq} [ci skip]

marcandre	2018-09-16 11:45:16 +0900 (Sun, 16 Sep 2018)

  New Revision: 64756

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64756

  Log:
    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 .

  Modified files:
    trunk/thread_sync.c
Index: thread_sync.c
===================================================================
--- thread_sync.c	(revision 64755)
+++ thread_sync.c	(revision 64756)
@@ -799,10 +799,12 @@ queue_do_push(VALUE self, struct rb_queu https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L799
  *
  * - +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.
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]