summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 15:50:49 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 15:50:49 +0000
commitf612f51c66f73db042709afbb13e926d89f60ccc (patch)
tree355a57de6bfe59a067645d4e996971007a8e426a
parentcb0c05138018f004d28b8dfb6c7b08732f814ba6 (diff)
merge revision(s) 39484,39485: [Backport #7952]
* thread.c: Document Thread::new, clean up ::fork and mention calling super if subclassing Thread git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--thread.c27
-rw-r--r--version.h2
3 files changed, 29 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a107669ee5..1593bbb118 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 11 00:50:21 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * thread.c: Document Thread::new, clean up ::fork and mention calling
+ super if subclassing Thread
+
Mon Mar 11 00:47:47 2013 Akinori MUSHA <knu@iDaemons.org>
* configure.in (unexpand_shvar): Use the numeric comparison
diff --git a/thread.c b/thread.c
index 899cb70c50..99406bcd4d 100644
--- a/thread.c
+++ b/thread.c
@@ -622,7 +622,26 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
return thval;
}
-/* :nodoc: */
+/*
+ * call-seq:
+ * Thread.new { ... } -> thread
+ * Thread.new(*args, &proc) -> thread
+ * Thread.new(*args) { |args| ... } -> thread
+ *
+ * Creates a new thread executing the given block.
+ *
+ * Any +args+ given to ::new will be passed to the block:
+ *
+ * arr = []
+ * a, b, c = 1, 2, 3
+ * Thread.new(a,b,c) { |d,e,f| arr << d << e << f }.join
+ * arr #=> [1, 2, 3]
+ *
+ * A ThreadError exception is raised if ::new is called without a block.
+ *
+ * If you're going to subclass Thread, be sure to call super in your
+ * +initialize+ method, otherwise a ThreadError will be raised.
+ */
static VALUE
thread_s_new(int argc, VALUE *argv, VALUE klass)
{
@@ -646,9 +665,9 @@ thread_s_new(int argc, VALUE *argv, VALUE klass)
* Thread.start([args]*) {|args| block } -> thread
* Thread.fork([args]*) {|args| block } -> thread
*
- * Basically the same as <code>Thread::new</code>. However, if class
- * <code>Thread</code> is subclassed, then calling <code>start</code> in that
- * subclass will not invoke the subclass's <code>initialize</code> method.
+ * Basically the same as ::new. However, if class Thread is subclassed, then
+ * calling +start+ in that subclass will not invoke the subclass's
+ * +initialize+ method.
*/
static VALUE
diff --git a/version.h b/version.h
index 887a348427..f5b2b55897 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-03-11"
-#define RUBY_PATCHLEVEL 47
+#define RUBY_PATCHLEVEL 48
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 3