Async::SafeSourceAsyncSafeself

class << self

Definitions

attr_reader :monitor

Signature

attribute Monitor

The global monitoring instance.

def enable!

Enable thread safety monitoring.

This activates a TracePoint that detects concurrent access to objects across fibers and threads. There is no performance overhead when monitoring is disabled.

Objects can move freely between fibers - only actual concurrent access (data races) is detected and reported.

Implementation

def enable!
	@monitor ||= Monitor.new
	@monitor.enable!
end

def disable!

Disable thread safety monitoring.

Implementation

def disable!
	@monitor&.disable!
	@monitor = nil
end

def transfer(*objects)

Transfer has no effect in concurrency monitoring mode.

Objects can move freely between fibers. This method is kept for backward compatibility but does nothing.

Signature

parameter objects Array(Object)

The objects to transfer (ignored).

Implementation

def transfer(*objects)
	# No-op - objects can move freely between fibers
end