Guest User

Untitled

a guest
Aug 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. puts "Test start"
  2.  
  3. puts "Create thread"
  4.  
  5. message = ARGV[0] ||= '0'
  6. begin
  7. t = Thread.new do
  8. puts "Start thread"
  9. begin
  10. raise "chatched"
  11. rescue => t_ex
  12. p message + t_ex.message
  13. end
  14. puts "End thread"
  15. end
  16. rescue => ex
  17. p ex.message
  18. end
  19.  
  20. puts "Waiting for the thread to complete"
  21. t.join
  22.  
  23. puts "Test compleated"
Add Comment
Please, Sign In to add comment