Entries from 2005-07-16 to 1 day

Single Threaded Execution

require 'thread' class Client def initialize(gate, name) @gate = gate @name = name @t = Thread.new { do_run } end def do_run 3.times do @gate.pass(@name) end end def join @t.join end end class Gate def initialize @counter = 0 @mutex = Mute…