Skip to content

Instantly share code, notes, and snippets.

@kosaki
Created December 3, 2012 16:33
Show Gist options
  • Select an option

  • Save kosaki/4196132 to your computer and use it in GitHub Desktop.

Select an option

Save kosaki/4196132 to your computer and use it in GitHub Desktop.
mutex = Mutex.new
Thread.async_interrupt_timing(Object => :on_blocking) {
mutex.synchronize {
begin
sleep 1
condvar.wait mutex
ensure
リソース解放したい
end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment