Skip to content

Synchronize state in AbstractVariable and Argv#8232

Merged
headius merged 1 commit intojruby:masterfrom
headius:argv_embedding_synchronization
May 15, 2024
Merged

Synchronize state in AbstractVariable and Argv#8232
headius merged 1 commit intojruby:masterfrom
headius:argv_embedding_synchronization

Conversation

@headius
Copy link
Member

@headius headius commented May 9, 2024

These fields are changed together but without any synchronization or atomicity. Simplest fix for now is to synchronize the methods and mark them as volatile.

Fixes #8178

I looked over other descendants of AbstractVariable but none of them had state changes like Argv.

I also tried to figure out a way to encapsulate those fields better but I will look at that a different time after learning why these variables work this way.

These fields are changed together but without any synchronization
or atomicity. Simplest fix for now is to synchronize the methods
and mark them as volatile.

Fixes jruby#8178
@headius headius added this to the JRuby 9.4.8.0 milestone May 9, 2024
@headius headius merged commit 733d2c4 into jruby:master May 15, 2024
@headius headius deleted the argv_embedding_synchronization branch May 15, 2024 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java::JavaLang::ClassCastException: class org.jruby.java.proxies.ConcreteJavaProxy cannot be cast to class org.jruby.RubyArray

1 participant