From: Masatoshi SEKI Date: 2001-05-20T07:24:09+09:00 Subject: [ruby-talk:15407] Re: PROPOSAL: Java-like method-based synchronization mechanism in Rub y Hi, > require �synchronized� > > class Demo > > def method1() > ... > end > > def method2() > ... > end > > synchronized (:test1) > end > Note: �synchronized� is to be applied in the same manner as �attr_reader�, > �attr_writer�, etc. > Any comments, improvements? > Something for the RAA? I wrote the MutexM. (--> http://www.ruby-lang.org/en/raa-list.rhtml?name=MutexM) class Demo include MutexM def initialize super @foo = nil @bar = 'bar' end synchronize_reader(:foo) synchronize_accessor(:bar) def method1() ... end synchronized :method1 def method2() synchronize do ... mothod1() # <-- Don't block! ... end end end