Class: Ori::Scope::ThreadLocalState

Inherits:
Object
  • Object
show all
Defined in:
lib/ori/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeThreadLocalState

Returns a new instance of ThreadLocalState.



21
22
23
24
25
26
27
28
29
# File 'lib/ori/scope.rb', line 21

def initialize
  @fiber_ids = LazyHash.new
  @tasks = LazyHash.new
  @pending = LazyArray.new
  @readable = LazyHashSet.new
  @writable = LazyHashSet.new
  @waiting = LazyHash.new
  @blocked = LazyHash.new
end

Instance Attribute Details

#blockedObject (readonly)

Returns the value of attribute blocked.



13
14
15
# File 'lib/ori/scope.rb', line 13

def blocked
  @blocked
end

#fiber_idsObject (readonly)

Returns the value of attribute fiber_ids.



13
14
15
# File 'lib/ori/scope.rb', line 13

def fiber_ids
  @fiber_ids
end

#pendingObject (readonly)

Returns the value of attribute pending.



13
14
15
# File 'lib/ori/scope.rb', line 13

def pending
  @pending
end

#readableObject (readonly)

Returns the value of attribute readable.



13
14
15
# File 'lib/ori/scope.rb', line 13

def readable
  @readable
end

#tasksObject (readonly)

Returns the value of attribute tasks.



13
14
15
# File 'lib/ori/scope.rb', line 13

def tasks
  @tasks
end

#waitingObject (readonly)

Returns the value of attribute waiting.



13
14
15
# File 'lib/ori/scope.rb', line 13

def waiting
  @waiting
end

#writableObject (readonly)

Returns the value of attribute writable.



13
14
15
# File 'lib/ori/scope.rb', line 13

def writable
  @writable
end

Instance Method Details

#child_scopesObject



31
32
33
# File 'lib/ori/scope.rb', line 31

def child_scopes
  @child_scopes ||= Set.new
end

#child_scopes?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/ori/scope.rb', line 35

def child_scopes?
  defined?(@child_scopes) && !@child_scopes.empty?
end