------ art_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) <simon.kroeger.ext / siemens.com> 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
>
>
------ art_31473_25133910.1145633301580--