Skip to content

Synchronize ASMHelpers.copyMethodNode - #231

Open
VortexSo4 wants to merge 1 commit into
masterfrom
faster-loading
Open

VortexSo4 wants to merge 1 commit into
masterfrom
faster-loading

Conversation

@VortexSo4

Copy link
Copy Markdown

Summary

Requires GTNewHorizons/RetroFuturaBootstrap#30 to merge.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

}

public static MethodNode copyMethodNode(MethodNode methodNode) {
public static synchronized MethodNode copyMethodNode(MethodNode methodNode) {

@Nikolay-Sitnikov Nikolay-Sitnikov Oct 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This doesn't access any state shared between threads. (unless you mean the MethodNode, in which case I think it's still safe, since this method doesn't mutate the shared MethodNode), which makes it safe to use between threads (as long as no other threads access the MethodNode before the MethodNode is finalized.)

@Nikolay-Sitnikov

Copy link
Copy Markdown

I think all you'd have to do is synchronize

if (template == null) {
template = ASMHelpers.classNodeFor(loader, "li/cil/oc/common/asm/template/SimpleEnvironment");
if (template == null) {
throw new Exception("Could not find SimpleComponent template!");
}
}

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.

2 participants