Skip to content

Instantly share code, notes, and snippets.

@emmx

emmx/foo.rb Secret

Created September 11, 2016 16:41
Show Gist options
  • Save emmx/db5699847b234e5938246e645dfc6cff to your computer and use it in GitHub Desktop.
Save emmx/db5699847b234e5938246e645dfc6cff to your computer and use it in GitHub Desktop.
class Test
def callme
Thread.new do
@myvar = 123
puts @myvar # Output: 123, expected: 123
end
sleep 3
Thread.new do
puts @myvar # Output: 123, expected: nil
end
end
end
Test.new.callme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment