What happened when i invoke Thread.current.stop

th1 = Thread.new {
Thread.current.stop # it should be Thread.stop
puts “i am running”
}

th1.run # some error

I know it should be Thread.stop, bu t anyone can tell me why?

thanks for the help!

Thanks for the help!

On Dec 24, 2007 4:34 PM, Jason Y. [email protected] wrote:

th1 = Thread.new {
Thread.current.stop # it should be Thread.stop
puts “i am running”
}

th1.run # some error

put Thread.abort_on_exception = true at top and get more enlightening
error. In a nutshell “stop” is a class method not an instance method.

Hence you can’t do:

Thread.current.stop

I know it should be Thread.stop, bu t anyone can tell me why?

thanks for the help!


Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.

http://gnufied.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs