Fiber::ProfilerSourceFiberProfilerThreadLocalCapture

module ThreadLocalCapture

Private module that wraps start/stop to manage thread-local storage.

Definitions

def start

Start profiling and store the capture in the current thread's thread-local storage.

Implementation

def start
	result = super
	
	if result
		Thread.current.fiber_profiler_capture = self
	end
	
	return result
end

def stop

Stop profiling and clear the capture from the current thread's thread-local storage.

Implementation

def stop
	result = super
	
	if result
		Thread.current.fiber_profiler_capture = nil
	end
	
	return result
end