summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/thread.c b/thread.c
index 9f2267a1f4..767f4bb9cb 100644
--- a/thread.c
+++ b/thread.c
@@ -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());
}
/*