Releases: AshOnDiscord/FTC-OffSeason
CmdX-Pedro-v0.1.0
[CmdX-Pedro] v0.1.0 Pedro Plugin for CmdX (+other util)
CmdX v0.1.2
[CmdX] v0.1.2 Add CommandScheduler.onSync, make Command.job `Job?` instead of lateinit, and fix concurrency issues with command groups
CmdX v0.1.1
Full Changelog: 9322d93...CmdX-v0.1.1
Main Changes
Rewrite syncing (and related) logic to improve thread safety and deadlock resistance. Should fix previous locking issues.
Details
Previously syncing worked by sending a message to other command's channels. Then we listen on our channel for N-1 messages (one from every other command). Once we've received every message we continue.
Instead now, we main a list of currently running command ids, and a map containing channels for each command on our top most parent. When each command enters the sync break-point we check to see if the map contains a channel for every other command, if not, we add our own channel and wait on the channel for just one message. Upon receiving it, it will resume. Whichever the last command is, the map will contain a channel for every other command and will proceed to send a message to everyone else. After messages are sent, the map is cleared again and the command resumes.
Besides this logic change, we also just generally protect more concurrent modification with mutexes for thread safety and deadlock resistance.