| So, here's what I think is happening: as we are looking up a key, we store a copy of the current instance of Invocation in the @current class variable here. If, when a new Invocation is initialized, @current is not nil, we think that the value of @current is our parent, so we copy the name_stack from that "parent" to the @name_stack for this instance. However, in a multithreaded environment, it is possible for @current to have been set by a different thread, so the new instance will think it has a parent when it does not. If that parent Invocation was trying to look up a key of the same name as the current instance, we will throw a RecursiveLookup error, because the name stack contains our key already. |