> 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?

AFAIK, that's the desired behavior - the pr proc was created while
$SAFE=0 and will be executed in that $SAFE=0 context. That allows you to
give a Safe environment access to unsafe things. 

Dan.