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

Proof methods in Plugin, PluginManager against concurrent access #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

A248
Copy link

@A248 A248 commented Aug 21, 2023

Coming up on the 3-year anniversary of the stale BungeeCord PR SpigotMC/BungeeCord#2945, I decided to re-implement the solutions with some enhancements and PR them to Waterfall instead.

Compared to the old PR, PluginManager's commandMap is now a concurrent map. Synchronization is limited to mutative operations, which supports non-blocking command execution and tab completion. Moreover, using the concurrent map maintains thread safety while allowing us to preserve the longstanding bug in PluginManager whereby plugins can mutate the return value of getCommands. A separate PR could address that bug if desired, but such is outside the scope of this one.

Retrieving plugin instances continues to be synchronized, but only where necessary; by assumption plugins do not load other plugins in onLoad.

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