Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
require "thread" Thread.abort_on_exception = true module Kernel alias unsafe_require require @@__require_mutex = Mutex.new def require(*args) @@__require_mutex.synchronize do unsafe_require(*args) end end end t1 = Thread.new do require "foo" Foo.new end t2 = Thread.new do require "foo" Foo.new end t1.join; t2.join
This paste will be private.
From the Design Piracy series on my blog: