Skip to content
New issue

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

Prevent scheduleRebuild from being called off-thread #2168

Merged

Conversation

embeddedt
Copy link
Contributor

Some mods try to schedule chunks to be rebuilt on background threads. In vanilla, this pattern generally manages to work due to how the chunk data structures are built, however, Sodium is much more sensitive to concurrency errors & crashes. To avoid undefined behavior, we simply throw an exception when scheduleRebuild is not called on the main thread.

@jellysquid3 jellysquid3 merged commit 14874cf into CaffeineMC:dev Dec 9, 2023
@jellysquid3 jellysquid3 added this to the Sodium 0.5.5 milestone Dec 9, 2023
@embeddedt embeddedt deleted the prevent-schedule-offthread branch December 22, 2023 16:54
IMS212 pushed a commit to IMS212/sodium-fabric that referenced this pull request Aug 6, 2024
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