[BUG?] $SAFE reset when proc called (1.8.4)

B

Bill Kelly

Hi,

I'm wondering if this is a bug? When the proc is called, the
safe_level is reverting to zero:


$ cat safe-test4.rb

pr = lambda{ puts "my_safe_level=#{Thread.current.safe_level}" }

th = Thread.new(pr) do |pr_|
$SAFE = 4
pr_.call
end
th.join



$ ruby -v safe-test.rb
ruby 1.8.4 (2005-12-24) [i386-mswin32]
my_safe_level=0



If this isn't a bug, does anyone know why this behavior would
be desirable?


Thanks,

Regards,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top