From: David Pollak Date: 2006-04-22T00:28:27+09:00 Subject: Re: Synchronized object ------=_Part_31473_25133910.1145633301580 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Simon, Look at the Monitor module. For example: require 'monitor' class Foo include MonitorMixin def bar self.synchronized do # stuff end end def baz self.synchronized do # more stuff end end end It's a little less syntactically sugary than Java, but about the same as C#= . Do this help? Thanks, David On 4/21/06, Kroeger, Simon (ext) wrote: > > Dear ruby-talk, > > is there a nice, concise way to lock each and > every method against all other methods of an object? > > To elaborate: I want to make sure that only one method of > a specific object (not class) can run at a each point in > time regardless of how many threads are using this object. > > I would hope there is module i just have to include in > my class definition. > > cheers and thanks > > Simon > > ------=_Part_31473_25133910.1145633301580--