Class: FiberAudit::Static::Rules::ThreadJoin

Inherits:
Base
  • Object
show all
Defined in:
lib/fiber_audit/static/rules/thread_join.rb

Overview

FA1002: Thread#join / Thread#value are scheduler coordination points.

Matches join/value on Thread instances whose receiver_constant is 'Thread' but whose receiver_source is not the bare literal 'Thread'. Covers direct constructor chains (Thread.new.join), assigned receivers (t = Thread.new; t.join), and the exact syntactic Thread.current form.

Skips direct Thread.join/value, arbitrary worker.join, wrong methods, and workspace-shadowed Thread (checked via workspace or workspace.semantic_index resolve_constant seam). Adapter errors from those seams are swallowed — they never raise.

Advisory rule: uses advisory_severity (no context ceiling), default :low.

Constant Summary collapse

TITLE =
'Thread wait'
CATEGORY =
:synchronization
MESSAGE =
'Thread#join/value requires scheduler block/unblock cooperation in a non-blocking Fiber.'
REMEDIATION =
'Verify scheduler coordination and runtime progress, ' \
'or move the wait outside the fiber-scheduled path.'
TARGET_METHODS =
OperationVocabulary::FA1002_METHODS
CANONICAL_OPS =
OperationVocabulary::FA1002_OPERATIONS
DIRECT_CLASS_SOURCE =
'Thread'

Constants inherited from Base

Base::CONTEXT_CEILING

Instance Method Summary collapse

Methods inherited from Base

confidence, default_confidence, default_severity, description, id, #initialize, severity

Constructor Details

This class inherits a constructor from FiberAudit::Static::Rules::Base

Instance Method Details

#analyze(call_sites:) ⇒ Object



40
41
42
# File 'lib/fiber_audit/static/rules/thread_join.rb', line 40

def analyze(call_sites:)
  call_sites.filter_map { |site| match(site) }
end