Repository navigation
Use volatile read in Folia scheduler task getStateVolatile - #14495
Merged
Merged
Conversation
VarHandle#get performs a plain read even when the underlying field is declared volatile. getStateVolatile in EntityScheduledTask and GlobalScheduledTask now uses getVolatile, matching its name and the existing setStateVolatile, which already uses setVolatile.
jpenilla
added a commit
to PaperMC/Folia
that referenced
this pull request
Nov 17, 2026
VarHandle#get is a plain read even on volatile fields. Match the setters and the rest of the codebase by using getVolatile. The FoliaEntityScheduler/FoliaGlobalRegionScheduler changes are carried from PaperMC/Paper#14495 until it is merged upstream.
R00tB33rMan
added a commit
to CraftCanvasMC/Canvas
that referenced
this pull request
Nov 17, 2026
VarHandle#get is a plain read even on volatile fields, so getStateVolatile in the region, entity and global region scheduler tasks and getReferenceCounterVolatile in the region task queue now use getVolatile, matching the setters and compare-and-exchange calls next to them. ThreadedRegion#getCenterSection also read each section's z from its x coordinate rather than its key, sorting sections by x alone. Port of PaperMC/Folia#534 and PaperMC/Folia@4613c9d, the FoliaEntityScheduler and FoliaGlobalRegionScheduler changes carried from PaperMC/Paper#14495 until it is merged
Machine-Maker
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VarHandle#get performs a plain read even when the underlying field is declared volatile. getStateVolatile in EntityScheduledTask and GlobalScheduledTask now uses getVolatile, matching its name and the existing setStateVolatile, which already uses setVolatile.