G
Garth Williams
Hi,
thread = Thread.new(thread) do |thisThread|
# thisThread.exit
puts "object id = #{thisThread.object_id}"
end
The code above seems to work, thisThread is the same as thread
(proved by uncommenting out the line), however in most languages this
would not work (I would expect thisThread to be nil), why does it
work in ruby and is it considered good practice?
Also is there a better way to access the current thread?
Thanks.
Garth.
thread = Thread.new(thread) do |thisThread|
# thisThread.exit
puts "object id = #{thisThread.object_id}"
end
The code above seems to work, thisThread is the same as thread
(proved by uncommenting out the line), however in most languages this
would not work (I would expect thisThread to be nil), why does it
work in ruby and is it considered good practice?
Also is there a better way to access the current thread?
Thanks.
Garth.