Michael Grosser, the Blog

Google+ LinkedIn Twitter

Menu

Skip to content
  • Home
  • About

Ruby: Kill all threads

In case you spam a lot of threads and dont know how to get rid of them…

Thread.list.each do |thread|
  thread.exit unless thread == Thread.current
end

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • More
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on Flattr (Opens in new window) Flattr
  • Click to print (Opens in new window) Print
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Tumblr (Opens in new window) Tumblr
Like Loading...

Related

2012-05-10pragmatig Ruby

Post navigation

← assert_change and assert_no_change for Test::Unit + Minitest inspired by RSpec
ActiveRecord slow_delete_all →

Leave a comment Cancel reply

  • Automated Sudo Password Prompt with SshKit
  • About
  • Producing Golang error backtraces / stacktraces

Recent Posts

  • Testing Kubernetes CEL admission/valdiation
  • Producing Golang error backtraces / stacktraces
  • Makefile: speedup go build & run by using mtimes
  • Datadog: Show Metric Usage Warning From HPA Metrics
  • Kubernetes Changelog from Audit log
Create a website or blog at WordPress.com
  • Comment
  • Reblog
  • Subscribe Subscribed
    • Michael Grosser, the Blog
    • Already have a WordPress.com account? Log in now.
    • Michael Grosser, the Blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d