--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: The calling thread will suspend execution and run thr. Does not return until thr exits or until limit seconds have passed. If the time limit expires, nil will be returned, otherwise thr is returned.
- !ruby/struct:SM::Flow::P
body: Any threads not joined will be killed when the main program exits. If thr had previously raised an exception and the abort_on_exception and $DEBUG flags are not set (so the exception has not yet been processed) it will be processed at this time.
- !ruby/struct:SM::Flow::VERB
body: " a = Thread.new { print "a"; sleep(10); print "b"; print "c" }\n x = Thread.new { print "x"; Thread.pass; print "y"; print "z" }\n x.join # Let x thread finish, a will be killed on exit.\n"
- !ruby/struct:SM::Flow::P
body: produces:
- !ruby/struct:SM::Flow::VERB
body: " axyz\n"
- !ruby/struct:SM::Flow::P
body: The following example illustrates the limit parameter.
- !ruby/struct:SM::Flow::VERB
body: " y = Thread.new { 4.times { sleep 0.1; puts 'tick... ' }}\n puts "Waiting" until y.join(0.15)\n"
- !ruby/struct:SM::Flow::P
body: produces:
- !ruby/struct:SM::Flow::VERB
body: " tick...\n Waiting\n tick...\n Waitingtick...\n\n tick...\n"
full_name: Thread#join
is_singleton: false
name: join
params: |
thr.join => thr
thr.join(limit) => thr
visibility: public