[Ironruby-core] DLR hosting

Curt Hagenlocher curth at microsoft.com
Fri Jan 30 08:22:43 EST 2009

It's part of Tomas' thread-safety work.  To enumerate the methods safely, you need to ensure that another thread isn't modifying the method list.

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero
Sent: Friday, January 30, 2009 4:47 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] DLR hosting

it will show that so far I've been working with instead of on IronRuby :) And then I've been focussed on using the Ruby language and .NET from Ruby instead of using C# to host Ironruby.

I'm using a debug build from IronRuby and the weird thing is that I have to add ClassHierarchyLocker.

            var controllerRubyClass = ScriptRuntime.Globals.GetVariable<RubyModule>(controllerRubyClassName);
            string controllerRubyMethodName = null;
            using (rubyContext.ClassHierarchyLocker())
                controllerRubyClass.EnumerateMethods((_, symbolId, __) =>
                                                             if (String.Equals(symbolId, actionName,
                                                                 controllerRubyMethodName = symbolId;
                                                                 return true;
                                                             return false;

The question I have here is: Why do I need the ClassHierarchyLocker ?

Cheers Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090130/4255cc3b/attachment.html>

More information about the Ironruby-core mailing list