Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2014-08-29から1日間の記事一覧

Ruby | Mutex | unlock

概要 Mutex#unlock -> self 詳細 mutex オブジェクトのロックを解除する。 サンプルコード require "thread" class Counter attr_reader :count def initialize @count = 0 @m = Mutex.new end def increment(id) @m.lock begin puts "inner lock #{id}" @co…