From 349f4e7db766e618d606768d5ead8cbc9f4ef74f Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 30 Dec 2003 16:38:32 +0000 Subject: 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 --- eval.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'eval.c') 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 + * block. Any arguments passed to Thread::new 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... + * + * produces: + * + * 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) /* - * Thread 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 sym - * refers to a symbol, which is either a quoted string or a Symbol - * (such as :name). - * + * 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 :name). */ void -- cgit v1.2.3