Skip to content

Instantly share code, notes, and snippets.

@anildigital
Created October 11, 2008 05:35
Show Gist options
  • Save anildigital/16217 to your computer and use it in GitHub Desktop.
Save anildigital/16217 to your computer and use it in GitHub Desktop.
class MyThread
def initialize(thread_name)
thread1(thread_name)
end
def thread1(thread_name)
Thread.new do
for i in (1..10)
puts "in #{thread_name} Thread"
sleep(1)
end
end
end
end
mt = MyThread.new("First")
mt2 = MyThread.new("Second")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment