Guest User

Untitled

a guest
Apr 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def kill_sub_thread
  2. Thread.new do
  3. grp = ThreadGroup.new
  4. grp.add(Thread.current)
  5. list = @grp.list
  6. while list.size > 0
  7. list.each do |th|
  8. th.kill if th.alive?
  9. end
  10. list = @grp.list
  11. end
  12. end
  13. end
Add Comment
Please, Sign In to add comment