summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
commit349f4e7db766e618d606768d5ead8cbc9f4ef74f (patch)
tree37c299cb289d0563962400250d7f7b9a30a0986c /eval.c
parent5e6d81e717879424edc46cda993799d8de7aa635 (diff)
Add RDoc for kernel functions, and tidy up
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 8c7850b569..1578dc7720 100644
--- a/eval.c
+++ b/eval.c
@@ -11367,6 +11367,24 @@ rb_thread_yield(arg, th)
return rb_yield_0(arg, 0, 0, Qtrue, Qtrue);
}
+/*
+ * call-seq:
+ * Thread.new([arg]*) {|args| block } => thread
+ *
+ * Creates and runs a new thread to execute the instructions given in
+ * <i>block</i>. Any arguments passed to <code>Thread::new</code> are passed
+ * into the block.
+ *
+ * x = Thread.new { sleep 0.1; print "x"; print "y"; print "z" }
+ * a = Thread.new { print "a"; print "b"; sleep 0.2; print "c" }
+ * x.join # Let the threads finish before
+ * a.join # main thread exits...
+ *
+ * <em>produces:</em>
+ *
+ * abxyzc
+ */
+
static VALUE
rb_thread_s_new(argc, argv, klass)
int argc;
@@ -11900,6 +11918,13 @@ rb_thread_keys(thread)
return ary;
}
+/*
+ * call-seq:
+ * thr.inspect => string
+ *
+ * Dump the name, id, and status of _thr_ to a string.
+ */
+
static VALUE
rb_thread_inspect(thread)
VALUE thread;
@@ -12253,13 +12278,12 @@ thgroup_add(group, thread)
/*
- * <code>Thread</code> encapsulates the behavior of a thread of
+ * +Thread+ encapsulates the behavior of a thread of
* execution, including the main thread of the Ruby script.
*
- * In the descriptions of the methods in this class, the parameter <i>sym</i>
- * refers to a symbol, which is either a quoted string or a <code>Symbol</code>
- * (such as <code>:name</code>).
- *
+ * In the descriptions of the methods in this class, the parameter _sym_
+ * refers to a symbol, which is either a quoted string or a
+ * +Symbol+ (such as <code>:name</code>).
*/
void