From: Robert Klemme Date: 2003-03-11T18:50:17+09:00 Subject: Re: Threads and DRb "Kent Dahl" schrieb im Newsbeitrag news:3E6D8640.68BEFA28@stud.ntnu.no... > "Hal E. Fulton" wrote: > > > a.extend ThreadSafe > > If it is always done like above, couldn't you do the > > > if not @__tsmutex then @__tsmutex = Mutex.new end > > In a system hook once per server object? > > http://www.rubycentral.com/book/ref_c_module.html#Module.extend_object Can't one just alias initialze and rededine it? module ThreadSafe alias __tsinit initialize def initialize(*args) @__tsmutex = Mutex.new __tsinit(*args) end def __send__(*args) @__tsmutex.synchronize { super(*args) } end end robert