Fix `thread_mattr_accessor` share variable superclass with subclass
#25681

willnet wants to merge willnet:fix-thread_mattr_accessor into rails:master

We do not currently have an analysis of these two commits