Repository navigation
Mutex, Queue, SizedQueue and ConditionVariable are Thread::Mutex and so on, as in MRI - #44
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…so on, as in MRI
The Threading library defined them at the top level and ruby4.rb aliased them into
Thread, so their name - and with it #inspect, #name and every error message that
names the class - was "Mutex" where MRI says "Thread::Mutex". They are now defined
in Thread (DefineIn) and the top-level names are the aliases.
ClassInitGenerator: a class nested in an unnamed extension of a CLR type was
qualified with the CLR name (System::Threading::Thread::Mutex). It now takes the
Ruby name another library of the assembly gives that type - the builtins'
[RubyClass("Thread", Extends = typeof(Thread))]. Regenerating also renames the
private loader methods of one Kernel extension (LoadIronRuby__Builtins__Kernel_*
to LoadKernel_*); nothing else in Initializers.Generated.cs changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Largo
force-pushed
the
fix/thread-class-names
branch
from
October 29, 2026 14:35
bb4a353 to
90f4d02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Threading library defined these four classes at the top level, and
ruby4.rbthen aliased them intoThread. As a resultMutex.name,#inspectand every error message that names the class saidMutexwhere MRI saysThread::Mutex:The classes are now defined in
ThreadwithDefineIn, andruby4.rbpublishes the top-levelMutex/Queue/SizedQueue/ConditionVariableas aliases, as MRI does.Mutex.equal?(Thread::Mutex)is still true, and reopeningclass Thread::Mutexorclass Mutexreaches the same class.ClassInitGenerator change
A class defined in an unnamed extension of a CLR type got the CLR name as its prefix:
System::Threading::Thread::Mutex. The Threading library'sThreadOpsis such an extension. Its other options both fail:"Thread"turns it into a definition, which can't reopen the builtin Thread at load ("cannot redefine class `Thread'").DefineIncan't point at the builtins'ThreadOps, because the generator only resolvesDefineInwithin one library.The generator now uses the top-level Ruby name that another library in the same assembly gives the extended type, here the builtins'
[RubyClass("Thread", Extends = typeof(Thread))].Regenerated
Initializers.Generated.cs: the Threading section changes as expected. The only other change is that one Kernel extension's private loader methods are renamed (LoadIronRuby__Builtins__Kernel_*→LoadKernel_*), with no change in behaviour. There's no reordering noise.RubyQueue.cschanges only in its[RubyClass]attribute line. Queue#pop is being worked on separately.Testing (Linux, net10.0)
Thread#killfiber flake that predates this change (see ConditionVariable#wait: no stale waiter after a failed wait, no lost signal at a timeout, MRI's timeout errors #42).Still different (not in this PR)
Marshal.dump(Queue.new)says "no _dump_data is defined for class Thread::Queue". MRI says "can't dump Thread::Queue". That's Queue's own code.UnboundMethod#inspecthas no source location (MRI:<internal:thread_sync>:100).🤖 Generated with Claude Code