GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of #19693.
Add thread_m/cattr_accessor/reader/writer suite of methods for declar…
…ing class and module variables that live per-thread
Use consistent references
Use separate test class name
Merge pull request #22630 from rails/attribute-accessors-per-thread
Add thread_m/cattr_accessor/reader/writer suite of methods for declaring class and module variables that live per-thread
I think you want to use thread_variable_get here
Nice. Didn't even see those had been added. Using those instead.
I'm pretty sure we don't want those. The fiber methods got the short name because they're the ones that people actually want 99% of the time... if you're not doing something very particular, what you really want is a "current-execution-stack-local" variable, and that's what fiber-locals give you.
As I confusingly mis-stated [and then corrected] around #19693 (comment), our existing internal usage is in PerThreadRegistry, which is actually per-fiber.
So, I think 301f438 should be reverted.
Anyone knows any reason why thread_mattr_accessor would be undefined when using jruby?
I'm having an issue with a gem I created (which depends on rails) where thread_mattr_accessor works fine when using MRI but is undefined when running with jruby.