Synchronization - After a Point in Time
suggest changesyncer = Queue.new
a = Thread.new do
syncer.pop
puts "this happens at end"
end
b = Thread.new do
puts "this happens first"
STDOUT.flush
syncer << :ok
end
[a, b].map(&:join)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents