Skip to content

Fix thread-safety issues in VAppearances initialization#11

Open
karlvr wants to merge 1 commit into
violetlib:masterfrom
karlvr:fix/thread-safety-init
Open

Fix thread-safety issues in VAppearances initialization#11
karlvr wants to merge 1 commit into
violetlib:masterfrom
karlvr:fix/thread-safety-init

Conversation

@karlvr
Copy link
Copy Markdown
Contributor

@karlvr karlvr commented Mar 25, 2026

I'm always a bit uncertain about how much thread safety we need in this area, but we've got a lot of synchronization around so I figure we're trying to to it properly.

Make initialize() synchronized to prevent a race condition where multiple threads could trigger double-initialization. Mark isInitialized, isLoaded, isEffectiveAppearanceSupported, and DEBUG_FLAG as volatile to ensure cross-thread visibility.

DEBUG_FLAG obviously a critical one ;-)

Make initialize() synchronized to prevent a race condition where multiple threads could trigger double-initialization. Mark isInitialized, isLoaded, isEffectiveAppearanceSupported, and DEBUG_FLAG as volatile to ensure cross-thread visibility.
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.

1 participant