diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -2952,18 +2952,16 @@ rb_thread_stop_p(VALUE thread) * call-seq: * thr.safe_level -> integer * - * Returns the safe level in effect for <i>thr</i>. Setting thread-local safe - * levels can help when implementing sandboxes which run insecure code. + * Returns the safe level. * - * thr = Thread.new { $SAFE = 1; sleep } - * Thread.current.safe_level #=> 0 - * thr.safe_level #=> 1 + * This method is obsolete because $SAFE is a process global state. + * Simply check $SAFE. */ static VALUE rb_thread_safe_level(VALUE thread) { - return INT2NUM(rb_thread_ptr(thread)->ec->safe_level); + return UINT2NUM(rb_safe_level()); } /* |