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

ruby-changes:70219

From: Victor <ko1@a...>
Date: Wed, 15 Dec 2021 11:25:47 +0900 (JST)
Subject: [ruby-changes:70219] 0fcc58a18c (master): [DOC] Improve Thread::Queue.new docs [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=0fcc58a18c

From 0fcc58a18c7c8896df1736fc644c1c9f84a6df0f Mon Sep 17 00:00:00 2001
From: Victor Shepelev <zverok.offline@g...>
Date: Wed, 15 Dec 2021 04:25:33 +0200
Subject: [DOC] Improve Thread::Queue.new docs [ci skip]

---
 thread_sync.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/thread_sync.c b/thread_sync.c
index 33a0d5e9ca2..eaf2c025b9b 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -838,14 +838,26 @@ queue_closed_result(VALUE self, struct rb_queue *q) https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L838
 /*
  * Document-method: Queue::new
  *
- * Creates a new queue instance, optionally using the contents of an Enumerable
+ * call-seq:
+ *   Thread::Queue.new -> empty_queue
+ *   Thread::Queue.new(enumerable) -> queue
+ *
+ * Creates a new queue instance, optionally using the contents of an +enumerable+
  * for its initial state.
  *
- *  Example:
+ * Example:
  *
  *    	q = Thread::Queue.new
- *    	q = Thread::Queue.new([a, b, c])
- *    	q = Thread::Queue.new(items)
+ *      #=> #<Thread::Queue:0x00007ff7501110d0>
+ *      q.empty?
+ *      #=> true
+ *
+ *    	q = Thread::Queue.new([1, 2, 3])
+ *    	#=> #<Thread::Queue:0x00007ff7500ec500>
+ *      q.empty?
+ *      #=> false
+ *      q.pop
+ *      #=> 1
  */
 
 static VALUE
-- 
cgit v1.2.1


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

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