Skip to content

Commit

Permalink
Smalruby.await/Character#awaitをSmalruby.startする前に呼び出した場合、sleepをつかってほん…
Browse files Browse the repository at this point in the history
…の少し待つように修正
  • Loading branch information
takaokouji committed Jul 18, 2014
1 parent f15b08d commit c4bd324
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/smalruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ def world
end

def await
@draw_mutex.synchronize do
@draw_cv.wait(@draw_mutex)
if Thread.current == Thread.main
sleep(1.0 / 15)
else
@draw_mutex.synchronize do
@draw_cv.wait(@draw_mutex)
end
end
end

Expand Down

0 comments on commit c4bd324

Please sign in to comment.