summaryrefslogtreecommitdiff
path: root/trace_point.rb
diff options
context:
space:
mode:
Diffstat (limited to 'trace_point.rb')
-rw-r--r--trace_point.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/trace_point.rb b/trace_point.rb
index db34e1b68d..85ebac9aa7 100644
--- a/trace_point.rb
+++ b/trace_point.rb
@@ -136,6 +136,22 @@ class TracePoint
end
# call-seq:
+ # TracePoint.allow_reentry
+ #
+ # In general, while a TracePoint callback is running,
+ # other registered callbacks are not called to avoid
+ # confusion by reentrance.
+ # This method allows the reentrance in a given block.
+ # This method should be used carefully, otherwise the callback
+ # can be easily called infinitely.
+ #
+ # If this method is called when the reentrance is already allowed,
+ # it raises a RuntimeError.
+ def self.allow_reentry
+ Primitive.tracepoint_allow_reentry
+ end
+
+ # call-seq:
# trace.enable(target: nil, target_line: nil, target_thread: nil) -> true or false
# trace.enable(target: nil, target_line: nil, target_thread: nil) { block } -> obj
#