Created
May 12, 2012 04:01
-
-
Save zhengjia/2664048 to your computer and use it in GitHub Desktop.
Revisions
-
zhengjia revised this gist
May 14, 2012 . 2 changed files with 0 additions and 13 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +0,0 @@ -
zhengjia revised this gist
May 12, 2012 . 2 changed files with 14 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ require 'thread' @value = 1 @cond = ConditionVariable.new @mutex = Mutex.new t = Thread.new do value = @value @mutex.synchronize do while true STDOUT.puts value @cond.wait @mutex end end end -
zhengjia created this gist
May 12, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ require 'thread' @value = 1 @cond = ConditionVariable.new @mutex = Mutex.new t = Thread.new do @mutex.synchronize do while true STDOUT.puts @value @cond.wait @mutex end end end