From: Bill Atkins Date: 2005-02-07T12:52:38+09:00 Subject: Re: Stopping a thread Brilliant! Thanks! On Mon, 7 Feb 2005 12:50:09 +0900, Assaph Mehr wrote: > > Bill Atkins wrote: > > Say I have a thread in variable @thread. Is it possible to stop that > > thread from the main thread? I am aware of Thread.stop, but I don't > > want to stop the current thread, just the thread represented in > > @thread. > > Look at Thread#kill. e.g.: > > @thread = Thread.new { > while true > puts 'still going' > sleep 2 > end > } > > sleep 7 > @thread.kill > puts 'done' > > -- $stdout.sync = true "Just another Ruby hacker.".each_byte do |b| ('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr end; print "\n"