On Tue, 12 Jun 2007 00:50:36 +0900, Alex Young <alex / blackkettle.org> wrote:
>>> irb(main):006:0> a.owner = :foo
>>> NoMethodError: undefined method `owner=' for #<Mutex:0xb788184c>
>>>         from (irb):6

Out of curiosity, how did it work with earlier versions of fastthread?  fastthread never stored the current owner in @owner.

> It's in some legacy code that broke on a gem update.  It's used for
> logging which thread's currently got the lock from inside a #synchronize
> block.  I've fixed it by changing the require order, which I don't like
> much.  It could probably be refactored out, but that's not the point...

Modifying Mutex isn't a very safe way to accomplish that, particularly as you can't rely on implementation details (because the implementation of Mutex is different for each Ruby implementation).  If the owner information is important to record, you'd be much better off writing a wrapper around Mutex and using that instead.

-mental