On Apr 21, 2006, at 9:47 AM, 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.

You could wrap it in a delegate object you strip of methods, then  
just have method_missing() forward the messages inside a synchronize  
block.

James Edward Gray II