# What happened when i invoke Thread.current.stop

**URL:** <https://www.ruby-forum.com/t/what-happened-when-i-invoke-thread-current-stop/124073>\
**Category:** Ruby\
**Created:** [December 24, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/what-happened-when-i-invoke-thread-current-stop/124073 "2007-12-24T12:05:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jason\_Y](https://www.ruby-forum.com/u/Jason_Y)\
**Post date:** [December 24, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/what-happened-when-i-invoke-thread-current-stop/124073/1 "2007-12-24T12:05:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Jason\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jason\_Y](https://www.ruby-forum.com/u/Jason_Y)\
**Post date:** [December 24, 2007, 1:30pm UTC](https://www.ruby-forum.com/t/what-happened-when-i-invoke-thread-current-stop/124073/2 "2007-12-24T13:30:55Z")

</div>

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Jason\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jason\_Y](https://www.ruby-forum.com/u/Jason_Y)\
**Post date:** [December 24, 2007, 12:35pm UTC](https://www.ruby-forum.com/t/what-happened-when-i-invoke-thread-current-stop/124073/3 "2007-12-24T12:35:47Z")

</div>

On Dec 24, 2007 4:34 PM, Jason Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://gnufied.org)
