thread_rdoc_fix.patch

Andrei Kulakov, 03/12/2011 08:26 PM

Download (1.14 KB)

View differences:

thread.c 2011-03-12 13:18:44.416043982 +0200
2074 2074
 *  either a symbol or a string name. If the specified variable does not exist,
2075 2075
 *  returns <code>nil</code>.
2076 2076
 *
2077
 *     a = Thread.new { Thread.current["name"] = "A"; Thread.stop }
2078
 *     b = Thread.new { Thread.current[:name]  = "B"; Thread.stop }
2079
 *     c = Thread.new { Thread.current["name"] = "C"; Thread.stop }
2080
 *     Thread.list.each {|x| puts "#{x.inspect}: #{x[:name]}" }
2077
 *     a = Thread.new { Thread.current["name"] = "A" }
2078
 *     b = Thread.new { Thread.current[:name]  = "B" }
2079
 *     c = Thread.new { Thread.current["name"] = "C" }
2080
 *
2081
 *     Thread.list.each do |thr|
2082
 *       thr.join unless thr == Thread.main
2083
 *       puts "#{thr.inspect}: #{thr[:name]}"
2084
 *     end
2081 2085
 *
2082 2086
 *  <em>produces:</em>
2083 2087
 *
2084
 *     #<Thread:0x401b3b3c sleep>: C
2085
 *     #<Thread:0x401b3bc8 sleep>: B
2086
 *     #<Thread:0x401b3c68 sleep>: A
2087
 *     #<Thread:0x401bdf4c run>:
2088
 *     #<Thread:0x88bf918 run>:
2089
 *     #<Thread:0x88b22cc dead>: A
2090
 *     #<Thread:0x88b2290 dead>: B
2091
 *     #<Thread:0x88b2254 dead>: C
2088 2092
 */
2089 2093

  
2090 2094
static VALUE