Commits

Steven! Ragnarök committed 5740f00

Test thread variables behave as expected.

Comments (0)

Files changed (1)

+class Foo
+  def self.record value
+    @value = value
+  end
+
+  def self.playback
+    @value
+  end
+end
+
+@thread = Thread.new do
+  Foo.record :bar
+  $stdout.puts "IN THREAD: #{Foo.playback || "playback is nil"}"
+end
+
+# protect from infinite loop.
+counter = 10000000
+Thread.pass until (counter -= 1) < 0
+
+$stdout.puts "OUT OF THREAD: #{Foo.playback || "playback is nil"}"