diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-30 16:38:32 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-30 16:38:32 +0000 |
commit | 349f4e7db766e618d606768d5ead8cbc9f4ef74f (patch) | |
tree | 37c299cb289d0563962400250d7f7b9a30a0986c /eval.c | |
parent | 5e6d81e717879424edc46cda993799d8de7aa635 (diff) | |
download | ruby-349f4e7db766e618d606768d5ead8cbc9f4ef74f.tar.gz |
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.c | 34 |
1 files changed, 29 insertions, 5 deletions
@@ -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 |