Skip to content

异步调用 LiteBlock race condition (Lite stack) #9

@duangsuse

Description

@duangsuse

Describe the bug
Lite 的本地作用域 stack 会因为异步块操作导致块所访问到的作用域错位

To Reproduce
Steps to reproduce the behavior:

race = lite.proxy Runnable, {
  run: { @a = 1; Thread.sleep(Math.random() * 10); return }
}

for _ in 0..15
  Thread(race).start()
end

while true
  if @a; break # @a should always be nil
end

Expected behavior
@A should always be nil
while should run forever

Additional context
F**king bugs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions